Neos.Neos/Classes/Domain/Service/UserService.php
public function currentUserCanPublishToWorkspace(Workspace $workspace)
    {
        if ($workspace->getName() === 'live') {
            return $this->securityContext->hasRole('Neos.Neos:LivePublisher');
        }

        if ($workspace->getOwner() === $this->getCurrentUser() || $workspace->getOwner() === null) {
            return true;
        }

        return false;
    }
public function currentUserCanPublishToWorkspace(Workspace $workspace)
    {
        if ($workspace->getName() === 'live') {
            return $this->securityContext->hasRole('Neos.Neos:LivePublisher');
        }

        if ($workspace->getOwner() === $this->getCurrentUser() || $workspace->getOwner() === null) {
            return true;
        }

        return false;
    }
public function currentUserCanPublishToWorkspace ( Workspace $ workspace ) { if ( $ workspace -> getName ( ) === 'live' ) { return $ this -> securityContext -> hasRole ( 'Neos.Neos:LivePublisher' ) ; } if ( $ workspace -> getOwner ( ) === $ this -> getCurrentUser ( ) || $ workspace -> getOwner ( ) === null ) { return true ; } return false ; }
Checks if the current user may publish to the given workspace according to one the roles of the user's accounts

In future versions, this logic may be implemented in Neos in a more generic way (for example, by means of an
ACL object), but for now, this method exists in order to at least centralize and encapsulate the required logic.

@param Workspace $workspace The workspace
@return boolean
Checks if the current user may publish to the given workspace according to one the roles of the user s accounts