public function hasPolicy($sec, $ptype, $rule)
    {
        if (!isset($this->model[$sec][$ptype])) {
            return false;
        }

        foreach ($this->model[$sec][$ptype]->policy as $r) {
            if (empty(array_diff($rule, $r))) {
                return true;
            }
        }

        return false;
    }
public function hasPolicy($sec, $ptype, $rule)
    {
        if (!isset($this->model[$sec][$ptype])) {
            return false;
        }

        foreach ($this->model[$sec][$ptype]->policy as $r) {
            if (empty(array_diff($rule, $r))) {
                return true;
            }
        }

        return false;
    }
public function hasPolicy ( $ sec , $ ptype , $ rule ) { if ( ! isset ( $ this -> model [ $ sec ] [ $ ptype ] ) ) { return false ; } foreach ( $ this -> model [ $ sec ] [ $ ptype ] -> policy as $ r ) { if ( empty ( array_diff ( $ rule , $ r ) ) ) { return true ; } } return false ; }
determines whether a model has the specified policy rule.

@param string $sec
@param string $ptype
@param array  $rule

@return bool
determines whether a model has the specified policy rule .