Neos\ContentRepository\Service\AuthorizationService::isGrantedToEditNode PHP Method

isGrantedToEditNode() public method

Returns TRUE if the currently authenticated user is allowed to edit the given $node, otherwise FALSE
public isGrantedToEditNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : boolean
$node Neos\ContentRepository\Domain\Model\NodeInterface
return boolean
    public function isGrantedToEditNode(NodeInterface $node)
    {
        return $this->privilegeManager->isGranted(EditNodePrivilege::class, new NodePrivilegeSubject($node));
    }

Usage Example

 /**
  * Wrap the $content identified by $node with the needed markup for the backend.
  *
  * @param NodeInterface $node
  * @param string $property
  * @param string $content
  * @return string
  */
 public function wrapContentProperty(NodeInterface $node, $property, $content)
 {
     /** @var $contentContext ContentContext */
     $contentContext = $node->getContext();
     if ($contentContext->getWorkspaceName() === 'live' || !$this->privilegeManager->isPrivilegeTargetGranted('Neos.Neos:Backend.GeneralAccess')) {
         return $content;
     }
     if (!$this->nodeAuthorizationService->isGrantedToEditNode($node)) {
         return $content;
     }
     $attributes = array();
     $attributes['class'] = 'neos-inline-editable';
     $attributes['property'] = 'typo3:' . $property;
     $attributes['data-neos-node-type'] = $node->getNodeType()->getName();
     return $this->htmlAugmenter->addAttributes($content, $attributes, 'span');
 }
All Usage Examples Of Neos\ContentRepository\Service\AuthorizationService::isGrantedToEditNode