diff --git a/framework/filters/AccessRule.php b/framework/filters/AccessRule.php index decb4365a86..476c86e9958 100644 --- a/framework/filters/AccessRule.php +++ b/framework/filters/AccessRule.php @@ -242,9 +242,7 @@ protected function matchRole($user) return true; } } else { - if (!isset($roleParams)) { - $roleParams = !is_array($this->roleParams) && is_callable($this->roleParams) ? call_user_func($this->roleParams, $this) : $this->roleParams; - } + $roleParams = !is_array($this->roleParams) && is_callable($this->roleParams) ? call_user_func($this->roleParams, $this) : $this->roleParams; if ($user->can($item, $roleParams)) { return true; }