lib: Reduce else { if { to elseif { in User::can()
This commit is contained in:
parent
127ce7abfe
commit
e5b0b52874
|
@ -426,15 +426,13 @@ class User
|
||||||
foreach ($this->permissions as $permitted) {
|
foreach ($this->permissions as $permitted) {
|
||||||
$wildcard = strpos($permitted, '*');
|
$wildcard = strpos($permitted, '*');
|
||||||
if ($wildcard !== false) {
|
if ($wildcard !== false) {
|
||||||
|
}
|
||||||
if (substr($permission, 0, $wildcard) === substr($permitted, 0, $wildcard)) {
|
if (substr($permission, 0, $wildcard) === substr($permitted, 0, $wildcard)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} elseif ($permission === $permitted) {
|
||||||
if ($permission === $permitted) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue