Clean up for logging

This commit is contained in:
David Bomba 2023-02-20 20:43:22 +11:00
parent 2662638974
commit 4b950fcfd2

View File

@ -504,20 +504,17 @@ class User extends Authenticatable implements MustVerifyEmail
public function hasExcludedPermissions(array $matched_permission = [], array $excluded_permissions = []): bool
{
if ($this->isSuperUser()) {
nlog("returning false as is superuser");
return false;
}
foreach ($excluded_permissions as $permission) {
if ($this->hasExactPermission($permission)) {
nlog("returning false as has excluded permission {$permission}");
return false;
}
}
foreach($matched_permission as $permission) {
if ($this->hasExactPermission($permission)) {
nlog("returning true as has matched permission {$permission}");
return true;
}
}