1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +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'; $all_permission = $parts[0].'_all';
} }
//empty $all_permissions leads to stripos returning true;
return $this->isOwner() || return $this->isOwner() ||
$this->isAdmin() || $this->isAdmin() ||
(is_int(stripos($this->token()->cu->permissions, $all_permission))) || (is_int(stripos($this->token()->cu->permissions, $all_permission))) ||