Skip to content

Commit a7d887f

Browse files
committed
BUGFIX: Ensure that the live workspace is created WITH public viewing permission
1 parent 74cfaaa commit a7d887f

File tree

5 files changed

+5
-16
lines changed

5 files changed

+5
-16
lines changed

Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ public function migrateWorkspaceMetadataToWorkspaceService(\Closure $outputFn):
716716
];
717717
$roleAssignments[] = [
718718
'subject_type' => WorkspaceRoleSubjectType::GROUP->value,
719-
'subject' => 'Neos.Neos:Everybody',
719+
'subject' => 'Neos.Flow:Everybody',
720720
'role' => WorkspaceRole::VIEWER->value,
721721
];
722722
} elseif ($isInternalWorkspace) {

Neos.Neos/Classes/Domain/Import/LiveWorkspaceCreationProcessor.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
use Neos\ContentRepository\Export\ProcessingContext;
2020
use Neos\ContentRepository\Export\ProcessorInterface;
2121
use Neos\ContentRepository\Export\Severity;
22-
use Neos\Neos\Domain\Model\WorkspaceDescription;
23-
use Neos\Neos\Domain\Model\WorkspaceRole;
24-
use Neos\Neos\Domain\Model\WorkspaceRoleAssignment;
25-
use Neos\Neos\Domain\Model\WorkspaceTitle;
2622
use Neos\Neos\Domain\Service\WorkspaceService;
2723

2824
/**
@@ -44,7 +40,6 @@ public function run(ProcessingContext $context): void
4440
$context->dispatch(Severity::NOTICE, 'Workspace already exists, skipping');
4541
return;
4642
}
47-
$this->workspaceService->createRootWorkspace($this->contentRepository->id, WorkspaceName::forLive(), WorkspaceTitle::fromString('Live workspace'), WorkspaceDescription::fromString(''));
48-
$this->workspaceService->assignWorkspaceRole($this->contentRepository->id, WorkspaceName::forLive(), WorkspaceRoleAssignment::createForGroup('Neos.Neos:LivePublisher', WorkspaceRole::COLLABORATOR));
43+
$this->workspaceService->createLiveWorkspaceIfMissing($this->contentRepository->id);
4944
}
5045
}

Neos.Neos/Classes/Domain/Service/WorkspaceService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public function createLiveWorkspaceIfMissing(ContentRepositoryId $contentReposit
140140
}
141141
$this->createRootWorkspace($contentRepositoryId, $workspaceName, WorkspaceTitle::fromString('Public live workspace'), WorkspaceDescription::empty());
142142
$this->metadataAndRoleRepository->assignWorkspaceRole($contentRepositoryId, $workspaceName, WorkspaceRoleAssignment::createForGroup('Neos.Neos:LivePublisher', WorkspaceRole::COLLABORATOR));
143+
$this->metadataAndRoleRepository->assignWorkspaceRole($contentRepositoryId, $workspaceName, WorkspaceRoleAssignment::createForGroup('Neos.Flow:Everybody', WorkspaceRole::VIEWER));
143144
}
144145

145146
/**

Neos.Neos/Tests/Behavior/Features/ContentRepository/Security/EditNodePrivilege.feature

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ Feature: EditNodePrivilege related features
2929
"""
3030
And using identifier "default", I define a content repository
3131
And I am in content repository "default"
32-
And the command CreateRootWorkspace is executed with payload:
33-
| Key | Value |
34-
| workspaceName | "live" |
35-
| newContentStreamId | "cs-identifier" |
32+
And the live workspace exists
3633
And I am in workspace "live" and dimension space point {}
3734
And the command CreateRootNodeAggregateWithNode is executed with payload:
3835
| Key | Value |

Neos.Neos/Tests/Behavior/Features/ContentRepository/Security/ReadNodePrivilege.feature

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ Feature: ReadNodePrivilege related features
2929
"""
3030
And using identifier "default", I define a content repository
3131
And I am in content repository "default"
32-
And the command CreateRootWorkspace is executed with payload:
33-
| Key | Value |
34-
| workspaceName | "live" |
35-
| newContentStreamId | "cs-identifier" |
32+
And the live workspace exists
3633
And I am in workspace "live" and dimension space point {}
3734
And the command CreateRootNodeAggregateWithNode is executed with payload:
3835
| Key | Value |
@@ -64,7 +61,6 @@ Feature: ReadNodePrivilege related features
6461
| nodeAggregateId | "a" |
6562
| nodeVariantSelectionStrategy | "allSpecializations" |
6663
| tag | "subtree_a" |
67-
And the role VIEWER is assigned to workspace "live" for group "Neos.Flow:Everybody"
6864
When a personal workspace for user "editor" is created
6965
And content repository security is enabled
7066

0 commit comments

Comments
 (0)