Skip to content

Commit

Permalink
Remove unnecessary check in the AccessRule::matchRole()
Browse files Browse the repository at this point in the history
  • Loading branch information
neoka4 authored Jan 21, 2024
1 parent 0027227 commit 2794e25
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions framework/filters/AccessRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2794e25

Please sign in to comment.