/** * @param IWebUser $user the user object * * @return boolean whether the rule applies to the role */ protected function isRoleMatched($user) { if (empty($this->roles)) { return true; } foreach ($this->roles as $role) { if ($user->checkAccess($role)) { return true; } } return false; }
/** * @param IWebUser $user the user object * @return boolean whether the rule applies to the role */ protected function isRoleMatched($user) { if (empty($this->roles)) { return true; } foreach ($this->roles as $key => $role) { if (is_numeric($key)) { if ($user->checkAccess($role)) { return true; } } else { if ($user->checkAccess($key, $role)) { return true; } } } return false; }