X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FUser.php;h=db834b7a240ca423141f254a1494fc9916b82c22;hb=7c6716036321ba09846785720e81459aad55a323;hp=72286a4891e48a5d789d2ba682eb4eff53fb79a1;hpb=9aca4f1a99af65dc988d2f66e122e25456a4efd9;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',