1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

Tests around hasPermission

This commit is contained in:
David Bomba 2023-01-21 16:59:51 +11:00
parent c1563c571d
commit 0ae2260951

View File

@ -365,6 +365,8 @@ class User extends Authenticatable implements MustVerifyEmail
$all_permission = $parts[0].'_all';
}
//empty $all_permissions leads to stripos returning true;
return $this->isOwner() ||
$this->isAdmin() ||
(is_int(stripos($this->token()->cu->permissions, $all_permission))) ||