src/Sulu/Component/Content/Document/Subscriber/SecuritySubscriber.php
public function handlePersist(PersistEvent $event)
    {
        /** @var SecurityBehavior $document */
        $document = $event->getDocument();

        if (!$this->supports($document) || !$document->getPermissions()) {
            return;
        }

        $node = $event->getNode();

        foreach ($document->getPermissions() as $roleId => $permission) {
            // TODO use PropertyEncoder, once it is refactored
            $node->setProperty('sec:role-' . $roleId, $this->getAllowedPermissions($permission));
        }
    }
public function handlePersist(PersistEvent $event)
    {
        /** @var SecurityBehavior $document */
        $document = $event->getDocument();

        if (!$this->supports($document) || !$document->getPermissions()) {
            return;
        }

        $node = $event->getNode();

        foreach ($document->getPermissions() as $roleId => $permission) {
            // TODO use PropertyEncoder, once it is refactored
            $node->setProperty('sec:role-' . $roleId, $this->getAllowedPermissions($permission));
        }
    }
public function handlePersist ( PersistEvent $ event ) { /** @var SecurityBehavior $document */ $ document = $ event -> getDocument ( ) ; if ( ! $ this -> supports ( $ document ) || ! $ document -> getPermissions ( ) ) { return ; } $ node = $ event -> getNode ( ) ; foreach ( $ document -> getPermissions ( ) as $ roleId => $ permission ) { // TODO use PropertyEncoder, once it is refactored $ node -> setProperty ( 'sec:role-' . $ roleId , $ this -> getAllowedPermissions ( $ permission ) ) ; } }
Adds the security information to the node.

@param PersistEvent $event
Adds the security information to the node .