Neos\Flow\Security\Authorization\Privilege\Method\MethodPrivilegePointcutFilter::matches PHP Method

matches() public method

This method also creates a cache entry for every method, to cache the associated roles and privileges.
public matches ( string $className, string $methodName, string $methodDeclaringClassName, mixed $pointcutQueryIdentifier ) : boolean
$className string Name of the class to check the name of
$methodName string Name of the method to check the name of
$methodDeclaringClassName string Name of the class the method was originally declared in
$pointcutQueryIdentifier mixed Some identifier for this query - must at least differ from a previous identifier. Used for circular reference detection.
return boolean TRUE if the names match, otherwise FALSE
    public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier)
    {
        if ($this->filters === null) {
            $this->buildPointcutFilters();
        }
        $matches = false;
        /** @var PointcutFilterComposite $filter */
        foreach ($this->filters as $privilegeIdentifier => $filter) {
            if ($filter->matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier)) {
                $matches = true;
                $methodIdentifier = strtolower($className . '->' . $methodName);
                $hasRuntimeEvaluations = false;
                if ($filter->hasRuntimeEvaluationsDefinition() === true) {
                    $hasRuntimeEvaluations = true;
                    $this->runtimeExpressionEvaluator->addExpression($privilegeIdentifier, $filter->getRuntimeEvaluationsClosureCode());
                }
                $this->methodPermissions[$methodIdentifier][$privilegeIdentifier]['privilegeMatchesMethod'] = true;
                $this->methodPermissions[$methodIdentifier][$privilegeIdentifier]['hasRuntimeEvaluations'] = $hasRuntimeEvaluations;
            }
        }
        return $matches;
    }