public function getAllowedTargetWorkspaces()
    {
        $user = $this->domainUserService->getCurrentUser();

        $workspacesArray = [];
        /** @var Workspace $workspace */
        foreach ($this->workspaceRepository->findAll() as $workspace) {
            // FIXME: This check should be implemented through a specialized Workspace Privilege or something similar
            // Skip workspace not owned by current user
            if ($workspace->getOwner() !== null && $workspace->getOwner() !== $user) {
                continue;
            }
            // Skip own personal workspace
            if ($workspace === $this->userService->getPersonalWorkspace()) {
                continue;
            }

            if ($workspace->isPersonalWorkspace()) {
                // Skip other personal workspaces
                continue;
            }

            $workspaceArray = [
                'name' => $workspace->getName(),
                'title' => $workspace->getTitle(),
                'description' => $workspace->getDescription(),
                'readonly' => !$this->domainUserService->currentUserCanPublishToWorkspace($workspace)
            ];
            $workspacesArray[$workspace->getName()] = $workspaceArray;
        }

        return $workspacesArray;
    }
public function getAllowedTargetWorkspaces()
    {
        $user = $this->domainUserService->getCurrentUser();

        $workspacesArray = [];
        /** @var Workspace $workspace */
        foreach ($this->workspaceRepository->findAll() as $workspace) {
            // FIXME: This check should be implemented through a specialized Workspace Privilege or something similar
            // Skip workspace not owned by current user
            if ($workspace->getOwner() !== null && $workspace->getOwner() !== $user) {
                continue;
            }
            // Skip own personal workspace
            if ($workspace === $this->userService->getPersonalWorkspace()) {
                continue;
            }

            if ($workspace->isPersonalWorkspace()) {
                // Skip other personal workspaces
                continue;
            }

            $workspaceArray = [
                'name' => $workspace->getName(),
                'title' => $workspace->getTitle(),
                'description' => $workspace->getDescription(),
                'readonly' => !$this->domainUserService->currentUserCanPublishToWorkspace($workspace)
            ];
            $workspacesArray[$workspace->getName()] = $workspaceArray;
        }

        return $workspacesArray;
    }
public function getAllowedTargetWorkspaces ( ) { $ user = $ this -> domainUserService -> getCurrentUser ( ) ; $ workspacesArray = [ ] ; /** @var Workspace $workspace */ foreach ( $ this -> workspaceRepository -> findAll ( ) as $ workspace ) { // FIXME: This check should be implemented through a specialized Workspace Privilege or something similar // Skip workspace not owned by current user if ( $ workspace -> getOwner ( ) !== null && $ workspace -> getOwner ( ) !== $ user ) { continue ; } // Skip own personal workspace if ( $ workspace === $ this -> userService -> getPersonalWorkspace ( ) ) { continue ; } if ( $ workspace -> isPersonalWorkspace ( ) ) { // Skip other personal workspaces continue ; } $ workspaceArray = [ 'name' => $ workspace -> getName ( ) , 'title' => $ workspace -> getTitle ( ) , 'description' => $ workspace -> getDescription ( ) , 'readonly' => ! $ this -> domainUserService -> currentUserCanPublishToWorkspace ( $ workspace ) ] ; $ workspacesArray [ $ workspace -> getName ( ) ] = $ workspaceArray ; } return $ workspacesArray ; }
Get allowed target workspaces for current user

@return array
Get allowed target workspaces for current user