18
18
use Neos \Flow \Annotations as Flow ;
19
19
use Neos \Flow \Configuration \ConfigurationManager ;
20
20
use Neos \Flow \Mvc \Routing \UriBuilder ;
21
+ use Neos \Flow \Security \Context as SecurityContext ;
21
22
use Neos \Neos \Domain \Model \WorkspaceClassification ;
22
23
use Neos \Neos \Domain \Service \WorkspaceService ;
23
24
use Neos \Neos \Security \Authorization \ContentRepositoryAuthorizationService ;
@@ -34,6 +35,9 @@ final class ConfigurationProvider implements ConfigurationProviderInterface
34
35
#[Flow \Inject]
35
36
protected UserService $ userService ;
36
37
38
+ #[Flow \Inject]
39
+ protected SecurityContext $ securityContext ;
40
+
37
41
#[Flow \Inject]
38
42
protected ConfigurationManager $ configurationManager ;
39
43
@@ -97,8 +101,8 @@ public function getConfiguration(
97
101
*/
98
102
private function getAllowedTargetWorkspaces (ContentRepository $ contentRepository ): array
99
103
{
100
- $ backendUser = $ this ->userService -> getBackendUser ();
101
- if ($ backendUser === null ) {
104
+ $ authenticatedAccount = $ this ->securityContext -> getAccount ();
105
+ if ($ authenticatedAccount === null ) {
102
106
return [];
103
107
}
104
108
$ result = [];
@@ -107,7 +111,7 @@ private function getAllowedTargetWorkspaces(ContentRepository $contentRepository
107
111
if (!in_array ($ workspaceMetadata ->classification , [WorkspaceClassification::ROOT , WorkspaceClassification::SHARED ], true )) {
108
112
continue ;
109
113
}
110
- $ workspacePermissions = $ this ->contentRepositoryAuthorizationService ->getWorkspacePermissionsForUser ($ contentRepository ->id , $ workspace ->workspaceName , $ backendUser );
114
+ $ workspacePermissions = $ this ->contentRepositoryAuthorizationService ->getWorkspacePermissionsForAccount ($ contentRepository ->id , $ workspace ->workspaceName , $ authenticatedAccount );
111
115
if ($ workspacePermissions ->read === false ) {
112
116
continue ;
113
117
}
0 commit comments