src/Enforcer.php
public function denies($policyName, $subject, array $addl = array())
    {
        if (!is_array($policyName)) {
            $policyName = [$policyName];
        }
        foreach ($policyName as $name) {
            if (!isset($this->policySet[$name])) {
                throw new \InvalidArgumentException('Policy name "'.$name.'" not found');
            }
            $result = $this->evaluate($subject, $this->policySet[$name], $addl);
            if ($result === true) {
                return false;
            }
        }
        return true;
    }
public function denies($policyName, $subject, array $addl = array())
    {
        if (!is_array($policyName)) {
            $policyName = [$policyName];
        }
        foreach ($policyName as $name) {
            if (!isset($this->policySet[$name])) {
                throw new \InvalidArgumentException('Policy name "'.$name.'" not found');
            }
            $result = $this->evaluate($subject, $this->policySet[$name], $addl);
            if ($result === true) {
                return false;
            }
        }
        return true;
    }
public function denies ( $ policyName , $ subject , array $ addl = array ( ) ) { if ( ! is_array ( $ policyName ) ) { $ policyName = [ $ policyName ] ; } foreach ( $ policyName as $ name ) { if ( ! isset ( $ this -> policySet [ $ name ] ) ) { throw new \ InvalidArgumentException ( 'Policy name "' . $ name . '" not found' ) ; } $ result = $ this -> evaluate ( $ subject , $ this -> policySet [ $ name ] , $ addl ) ; if ( $ result === true ) { return false ; } } return true ; }
Locate a policy by name and evaluate if the subject is denied
by matching against its properties

@param string $policyName Policy key name
@param object $subject Subject to evluate against
@throws \InvalidArgumentException If policy name is not found
@return boolean Pass/fail of evluation
Locate a policy by name and evaluate if the subject is denied by matching against its properties