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;
    }