Skip to content
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

TASK: Properly re-remove obsolete legacy userInformation.personalWorkspaceName in policy for workspaces #5418

Open
wants to merge 2 commits into
base: 9.0
Choose a base branch
from

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Jan 6, 2025

Based on #5417

current.userInformation.personalWorkspaceName (UserService::getPersonalWorkspaceName()) was initially removed in c3f51e2

because with multiple content repositories we cannot find out the value:

public function getPersonalWorkspaceName(): ?string
{
    $currentUser = $this->userDomainService->getCurrentUser();
    $cr = 'default'; // TODO!!!
    $this->workspaceService->getPersonalWorkspaceForUser($cr, $currentUser);
    return $workspace->workspaceName->value;
}

This is luckily no longer needed as the now called NodeAddressToNodeConverter (which we decided to keep in Neos 9.0: #4873)
Will handle this itself through the security in ContentRepository::getContentSubgraph() via #5298

Additionally, this pr makes UserService::getPersonalWorkspaceName() throw and exception to ease upgrading as otherwise NULL will be evaluated.

With the introduction of explicit user assignments for workspaces neos#5146 and roles and the full evaluation of those via neos#5298 we have replaced the previously still kept 8.3 yaml security configuration for workspaces.

This decision was done as for security we can no longer use flows security framework which uses aop inside the content-repository library, and also we wanted to cleanup the user <-> workspace relation ship as well as the concept of internal vs shared workspaces.

Following yaml roles were removed:
- `Neos.ContentRepository:Administrator`
- `Neos.ContentRepository:InternalWorkspaceAccess`

Following yaml targets were removed:
- `Neos.Neos:PublicWorkspaceAccess`
- `Neos.Neos:OtherWorkspacesAccess`
- `Neos.Neos:Backend.OtherUsersPersonalWorkspaceAccess`
- `Neos.Neos:Backend.PublishOwnWorkspaceContent`
- `Neos.Neos:Backend.DiscardOwnWorkspaceContent`
- `Neos.Workspace.Ui:Backend.PublishAllToLiveWorkspace`

Note that these targets were moved to the `Neos.Workspace.Ui:Backend` package via neos#5118 in 9.0 but were removed now either way:

- `Neos.Neos:Backend.Module.Management.Workspaces.ManageOwnWorkspaces` (`Neos.Workspace.Ui:Backend.Module.Management.Workspace.ManageOwnWorkspaces`)
- `Neos.Neos:Backend.Module.Management.Workspaces.ManageInternalWorkspaces` (`Neos.Workspace.Ui:Backend.Module.Management.Workspace.ManageInternalWorkspaces`)
- `Neos.Neos:Backend.Module.Management.Workspaces.ManageAllPrivateWorkspaces` (`Neos.Workspace.Ui:Backend.Module.Management.Workspace.ManageAllPrivateWorkspaces`)
…kspaceName` in policy for workspaces

`current.userInformation.personalWorkspaceName` (`UserService::getPersonalWorkspaceName()`) was initially removed in c3f51e2

because with multiple content repositories we cannot find out the value:

```php
public function getPersonalWorkspaceName(): ?string
{
    $currentUser = $this->userDomainService->getCurrentUser();
    $cr = 'default'; // TODO!!!
    $this->workspaceService->getPersonalWorkspaceForUser($cr, $currentUser);
    return $workspace->workspaceName->value;
}
```

This is luckily no longer needed as the now called `NodeAddressToNodeConverter` (which we decided to keep in Neos 9.0: neos#4873)
Will handle this itself through the security in `ContentRepository::getContentSubgraph()` via neos#5298

Additionally, this pr makes `UserService::getPersonalWorkspaceName()` throw and exception to ease upgrading as otherwise `NULL` will be evaluated.
@mhsdesign mhsdesign force-pushed the task/fully-remove-userInformation-personalWorkspaceName branch from 1764550 to a03eb24 Compare January 6, 2025 10:32
@mhsdesign mhsdesign marked this pull request as ready for review January 9, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant