Update AccessRuleFilter to evaluate roleParams
The `roleParams` was not being evaluated earlier and has been included.
This commit is contained in:
committed by
GitHub
parent
409d6f334c
commit
7cb13457f2
@ -41,8 +41,13 @@ class AccessRuleFilter extends AccessRule
|
||||
if (!$user->getIsGuest() && $identity->getIsAdmin()) {
|
||||
return true;
|
||||
}
|
||||
} elseif ($user->can($role)) {
|
||||
return true;
|
||||
} else {
|
||||
if (!isset($roleParams)) {
|
||||
$roleParams = $this->roleParams instanceof Closure ? call_user_func($this->roleParams, $this) : $this->roleParams;
|
||||
}
|
||||
if ($user->can($role, $roleParams)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user