X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FUser.php;h=db834b7a240ca423141f254a1494fc9916b82c22;hb=07a88747f8a252b41b739185fcb68bdee3a60f9a;hp=72286a4891e48a5d789d2ba682eb4eff53fb79a1;hpb=b98dac4d596e4bed9a5f96526aa66ea8512ad2ab;p=alttp.git diff --git a/app/Models/User.php b/app/Models/User.php index 72286a4..db834b7 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -40,6 +40,10 @@ class User extends Authenticatable } + public function hasGlobalRole($name) { + return !empty($this->global_roles) && in_array($name, $this->global_roles); + } + public function isAdmin() { return $this->role === 'admin'; } @@ -226,6 +230,7 @@ class User extends Authenticatable 'avatar' => 'string', 'avatar_cached' => 'datetime', 'verified' => 'boolean', + 'global_roles' => 'array', 'locale' => 'string', 'mfa_enabled' => 'boolean', 'refresh_token' => 'encrypted',