Neos\Flow\Security\Authorization\Privilege\Method\MethodPrivilege::matchesSubject PHP Метод

matchesSubject() публичный Метод

Returns TRUE, if this privilege covers the given subject (join point)
public matchesSubject ( Neos\Flow\Security\Authorization\Privilege\PrivilegeSubjectInterface $subject ) : boolean
$subject Neos\Flow\Security\Authorization\Privilege\PrivilegeSubjectInterface
Результат boolean
    public function matchesSubject(PrivilegeSubjectInterface $subject)
    {
        if ($subject instanceof MethodPrivilegeSubject === false) {
            throw new InvalidPrivilegeTypeException(sprintf('Privileges of type "%s" only support subjects of type "%s", but we got a subject of type: "%s".', MethodPrivilegeInterface::class, MethodPrivilegeSubject::class, get_class($subject)), 1416241148);
        }
        $this->initialize();
        $joinPoint = $subject->getJoinPoint();
        $methodIdentifier = strtolower($joinPoint->getClassName() . '->' . $joinPoint->getMethodName());
        if (isset(static::$methodPermissions[$methodIdentifier][$this->getCacheEntryIdentifier()])) {
            if (static::$methodPermissions[$methodIdentifier][$this->getCacheEntryIdentifier()]['hasRuntimeEvaluations']) {
                if ($this->runtimeExpressionEvaluator->evaluate($this->getCacheEntryIdentifier(), $joinPoint) === false) {
                    return false;
                }
            }
            return true;
        }
        return false;
    }