Neos.Neos/Classes/Security/Authorization/Privilege/ModulePrivilege.php
public function matchesSubject(PrivilegeSubjectInterface $subject)
    {
        if (!($subject instanceof ModulePrivilegeSubject) && !($subject instanceof MethodPrivilegeSubject)) {
            throw new InvalidPrivilegeTypeException(
                sprintf(
                    'Privileges of type "%s" only support subjects of type "%s" or "%s", but we got a subject of type: "%s".',
                    self::class,
                    ModulePrivilegeSubject::class,
                    MethodPrivilegeSubject::class,
                    get_class($subject)
                ), 1493130646);
        }
        $this->initialize();
        if ($subject instanceof MethodPrivilegeSubject) {
            return $this->methodPrivilege->matchesSubject($subject);
        }
        return $subject->getModulePath() === $this->getParsedMatcher();
    }
public function matchesSubject(PrivilegeSubjectInterface $subject)
    {
        if (!($subject instanceof ModulePrivilegeSubject) && !($subject instanceof MethodPrivilegeSubject)) {
            throw new InvalidPrivilegeTypeException(
                sprintf(
                    'Privileges of type "%s" only support subjects of type "%s" or "%s", but we got a subject of type: "%s".',
                    self::class,
                    ModulePrivilegeSubject::class,
                    MethodPrivilegeSubject::class,
                    get_class($subject)
                ), 1493130646);
        }
        $this->initialize();
        if ($subject instanceof MethodPrivilegeSubject) {
            return $this->methodPrivilege->matchesSubject($subject);
        }
        return $subject->getModulePath() === $this->getParsedMatcher();
    }
public function matchesSubject ( PrivilegeSubjectInterface $ subject ) { if ( ! ( $ subject instanceof ModulePrivilegeSubject ) && ! ( $ subject instanceof MethodPrivilegeSubject ) ) { throw new InvalidPrivilegeTypeException ( sprintf ( 'Privileges of type "%s" only support subjects of type "%s" or "%s", but we got a subject of type: "%s".' , self :: class , ModulePrivilegeSubject :: class , MethodPrivilegeSubject :: class , get_class ( $ subject ) ) , 1493130646 ) ; } $ this -> initialize ( ) ; if ( $ subject instanceof MethodPrivilegeSubject ) { return $ this -> methodPrivilege -> matchesSubject ( $ subject ) ; } return $ subject -> getModulePath ( ) === $ this -> getParsedMatcher ( ) ; }
Returns true, if this privilege covers the given subject

@param PrivilegeSubjectInterface $subject
@return boolean
@throws InvalidPrivilegeTypeException if the given $subject is not supported by the privilege
Returns true if this privilege covers the given subject