public function allows($action, $user, $request) { if ($this->matchAction($action) && $this->matchRole($user) && $this->matchIP($request->getUserIP()) && $this->matchVerb($request->getMethod()) && $this->matchController($action->controller) && $this->matchCustom($action)) { return $this->allow ? true : false; } else { return null; } }
/** * @see http://www.yiiframework.com/doc-2.0/yii-filters-accessrule.html#allows()-detail * * Extends allows method with user role check */ public function allows($action, $user, $request) { if (parent::allows($action, $user, $request) !== null && $this->matchUserRoles($user)) { return $this->allow ? true : false; } return null; }