Make a condition more easy to read [MAILPOET-493]
This commit is contained in:
committed by
pavel-mailpoet
parent
a4f2d5402c
commit
2a4a44ebb5
@@ -107,10 +107,9 @@ class AccessControl {
|
||||
function validatePermission($permission) {
|
||||
if($permission === self::NO_ACCESS_RESTRICTION) return true;
|
||||
foreach($this->user_roles as $role) {
|
||||
if($role_object = get_role($role)) {
|
||||
if($role_object->has_cap($permission)) {
|
||||
return true;
|
||||
}
|
||||
$role_object = get_role($role);
|
||||
if($role_object && $role_object->has_cap($permission)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user