-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUGFIX: Fix workspace role assignment after migration, import and site creation #5283
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
use Neos\ContentRepository\Core\Projection\CatchUpOptions; | ||
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; | ||
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; | ||
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; | ||
use Neos\ContentRepository\Export\ExportService; | ||
use Neos\ContentRepository\Export\ExportServiceFactory; | ||
use Neos\ContentRepository\Export\ImportService; | ||
|
@@ -22,6 +23,9 @@ | |
use Neos\Flow\ResourceManagement\ResourceRepository; | ||
use Neos\Media\Domain\Repository\AssetRepository; | ||
use Neos\Neos\AssetUsage\AssetUsageService; | ||
use Neos\Neos\Domain\Model\WorkspaceRole; | ||
use Neos\Neos\Domain\Model\WorkspaceRoleAssignment; | ||
use Neos\Neos\Domain\Service\WorkspaceService; | ||
use Neos\Utility\Files; | ||
|
||
class CrCommandController extends CommandController | ||
|
@@ -40,6 +44,7 @@ public function __construct( | |
private readonly ContentRepositoryRegistry $contentRepositoryRegistry, | ||
private readonly ProjectionReplayServiceFactory $projectionReplayServiceFactory, | ||
private readonly AssetUsageService $assetUsageService, | ||
private readonly WorkspaceService $workspaceService, | ||
) { | ||
parent::__construct(); | ||
} | ||
|
@@ -114,6 +119,9 @@ public function importCommand(string $path, string $contentRepository = 'default | |
$projectionService = $this->contentRepositoryRegistry->buildService($contentRepositoryId, $this->projectionReplayServiceFactory); | ||
$projectionService->replayAllProjections(CatchUpOptions::create()); | ||
|
||
$this->outputLine('Assigning live workspace role'); | ||
$this->workspaceService->assignWorkspaceRole($contentRepositoryId, WorkspaceName::forLive(), WorkspaceRoleAssignment::createForGroup('Neos.Neos:LivePublisher', WorkspaceRole::COLLABORATOR)); | ||
Comment on lines
+122
to
+123
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. imo as hotfix we also should create a site entity for each imported site node here :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll take care of that in a follow-up There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also thie needs to be try catched, as a workspace role might already be assigned if you run this import before and then run |
||
|
||
$this->outputLine('<success>Done</success>'); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this statement
is wrong. .. also this is okay not to be there? We have runtime migration fallback? Why did we remove this check?