Skip to content

Commit

Permalink
BUGFIX: Use new workspace ui privilege names in userservice
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebobo committed Jul 18, 2024
1 parent 6d30803 commit 658a0e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Neos.Neos/Classes/Domain/Service/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -733,21 +733,21 @@ public function currentUserCanManageWorkspace(Workspace $workspace): bool

if ($workspace->isInternalWorkspace()) {
return $this->privilegeManager->isPrivilegeTargetGranted(
'Neos.Neos:Backend.Module.Management.Workspaces.ManageInternalWorkspaces'
'Neos.Workspace.Ui:Backend.Module.Management.Workspace.ManageInternalWorkspaces'
);
}


$currentUser = $this->getCurrentUser();

if ($workspace->isPrivateWorkspace() && $currentUser !== null && $workspace->workspaceOwner === $this->persistenceManager->getIdentifierByObject($currentUser)) {
return $this->privilegeManager->isPrivilegeTargetGranted(
'Neos.Neos:Backend.Module.Management.Workspaces.ManageOwnWorkspaces'
'Neos.Workspace.Ui:Backend.Module.Management.Workspace.ManageOwnWorkspaces'
);
}

if ($workspace->isPrivateWorkspace() && $currentUser !== null && $workspace->workspaceOwner !== $this->persistenceManager->getIdentifierByObject($currentUser)) {
return $this->privilegeManager->isPrivilegeTargetGranted(
'Neos.Neos:Backend.Module.Management.Workspaces.ManageAllPrivateWorkspaces'
'Neos.Workspace.Ui:Backend.Module.Management.Workspace.ManageAllPrivateWorkspaces'
);
}

Expand All @@ -771,7 +771,7 @@ public function currentUserCanTransferOwnershipOfWorkspace(Workspace $workspace)
// of their internal workspaces, even if it was technically possible, because they wouldn't be able to change
// ownership back to themselves.
return $this->privilegeManager->isPrivilegeTargetGranted(
'Neos.Neos:Backend.Module.Management.Workspaces.ManageInternalWorkspaces'
'Neos.Workspace.Ui:Backend.Module.Management.Workspace.ManageInternalWorkspaces'
);
}

Expand Down

0 comments on commit 658a0e2

Please sign in to comment.