Neos\ContentRepository\Domain\Service\Context::validateWorkspace PHP Method

validateWorkspace() public method

At the time of this writing, it is not possible in Flow to restrict access to Workspace through Entity Privileges because Workspaces are used at a very early stage during routing where the security context is not yet initialized. As a workaround, we use a Method Privilege which protects this validateWorkspace() method and thus prevents unauthorized access to a workspace when calling this context's getWorkspace() method. Since some privilege definitions check the "owner" property of a Workspace, we need a real Workspace object and not just the name - hence this method.
public validateWorkspace ( Workspace $workspace ) : void
$workspace Neos\ContentRepository\Domain\Model\Workspace The workspace to check
return void
    public function validateWorkspace(Workspace $workspace)
    {
        // if access to validateWorkspace() is granted, everything is fine, otherwise the security framework will
        // throw an exception
    }