Skip to content

Commit

Permalink
Merge pull request #5418 from mhsdesign/task/fully-remove-userInforma…
Browse files Browse the repository at this point in the history
…tion-personalWorkspaceName

TASK: Properly re-remove obsolete legacy `userInformation.personalWorkspaceName` in policy for workspaces
  • Loading branch information
mhsdesign authored Jan 13, 2025
2 parents 01f1e0f + f36da15 commit af030d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 12 additions & 0 deletions Neos.Neos/Classes/Service/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ public function getBackendUser()
return $this->userDomainService->getCurrentUser();
}

/**
* 8.3 behaviour: Returns the name of the currently logged in user's personal workspace
* (even if that might not exist at that time).
* If no user is logged in this method returns null.
*
* @deprecated and not implemented with Neos 9.0 - can be removed any time, just for the 8.3 upgrade phase
*/
public function getPersonalWorkspaceName(): ?string
{
throw new \LogicException('`userInformation.personalWorkspaceName` was removed in Neos 9.0 see https://github.com/neos/neos-development-collection/pull/5418');
}

/**
* Returns the stored preferences of a user
*
Expand Down
8 changes: 0 additions & 8 deletions Neos.Neos/Configuration/Policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ privilegeTargets:
label: Access to content service APIs
matcher: 'method(Neos\Neos\Controller\Backend\SchemaController->(nodeTypeSchema)Action()) || method(Neos\Neos\Controller\Backend\SettingsController->editPreviewAction())'

'Neos.Neos:Backend.PersonalWorkspaceReadAccess.NodeConverter':
label: Access to own personal workspace
matcher: 'method(Neos\Neos\TypeConverter\NodeConverter->prepareContextProperties(workspaceName === current.userInformation.personalWorkspaceName))'

'Neos.Neos:Backend.EditContent':
label: General access to content editing
matcher: 'method(Neos\Neos\Service\Controller\NodeController->(show|getPrimaryChildNode|getChildNodesForTree|filterChildNodesForTree|getChildNodes|getChildNodesFromParent|create|createAndRender|createNodeForTheTree|move|moveBefore|moveAfter|moveInto|moveAndRender|copy|copyBefore|copyAfter|copyInto|copyAndRender|update|updateAndRender|delete|searchPage|error)Action()) || method(Neos\Neos\Controller\Backend\ContentController->(uploadAsset|assetsWithMetadata|imageWithMetadata|createImageVariant|error)Action()) || method(Neos\Neos\Controller\Service\AssetProxiesController->(index|show|import|error)Action()) || method(Neos\Neos\Controller\Service\AssetsController->(index|show|error)Action()) || method(Neos\Neos\Controller\Service\NodesController->(index|show|create|error)Action())'
Expand Down Expand Up @@ -169,10 +165,6 @@ roles:
privilegeTarget: 'Neos.Neos:ContentPreview'
permission: GRANT

-
privilegeTarget: 'Neos.Neos:Backend.PersonalWorkspaceReadAccess.NodeConverter'
permission: GRANT

-
privilegeTarget: 'Neos.Neos:Backend.EditContent'
permission: GRANT
Expand Down

0 comments on commit af030d1

Please sign in to comment.