Neos\ContentRepository\Security\Authorization\Privilege\Node\RemoveNodePrivilege::matchesSubject PHP Method

matchesSubject() public method

public matchesSubject ( Neos\Flow\Security\Authorization\Privilege\PrivilegeSubjectInterface $subject ) : boolean
$subject Neos\Flow\Security\Authorization\Privilege\PrivilegeSubjectInterface
return boolean
    public function matchesSubject(PrivilegeSubjectInterface $subject)
    {
        if ($subject instanceof NodePrivilegeSubject === false && $subject instanceof MethodPrivilegeSubject === false) {
            throw new InvalidPrivilegeTypeException(sprintf('Privileges of type "%s" only support subjects of type "%s" or "%s", but we got a subject of type: "%s".', RemoveNodePrivilege::class, NodePrivilegeSubject::class, MethodPrivilegeSubject::class, get_class($subject)), 1417017296);
        }
        $this->initialize();
        if ($subject instanceof MethodPrivilegeSubject) {
            if ($this->methodPrivilege->matchesSubject($subject) === false) {
                return false;
            }
            /** @var NodeInterface $node */
            $node = $subject->getJoinPoint()->getProxy();
            $nodePrivilegeSubject = new NodePrivilegeSubject($node);
            return parent::matchesSubject($nodePrivilegeSubject);
        }
        return parent::matchesSubject($subject);
    }