Neos\Flow\Security\Authorization\TestingPrivilegeManager::isGranted PHP 메소드

isGranted() 공개 메소드

Returns TRUE, if the given privilege type is granted for the given subject based on the current security context or if set based on the override decision value.
public isGranted ( string $privilegeType, mixed $subject, string &$reason = '' ) : boolean
$privilegeType string
$subject mixed
$reason string This variable will be filled by a message giving information about the reasons for the result of this method
리턴 boolean
    public function isGranted($privilegeType, $subject, &$reason = '')
    {
        if ($this->overrideDecision === false) {
            $reason = 'Voting has been overriden to "DENY" by the testing privilege manager!';
            return false;
        } elseif ($this->overrideDecision === true) {
            $reason = 'Voting has been overriden to "GRANT" by the testing privilege manager!';
            return true;
        }
        return parent::isGranted($privilegeType, $subject, $reason);
    }