]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/User.php
basic content editing
[alttp.git] / app / Models / User.php
index 72286a4891e48a5d789d2ba682eb4eff53fb79a1..db834b7a240ca423141f254a1494fc9916b82c22 100644 (file)
@@ -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',