X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FUser.php;h=db834b7a240ca423141f254a1494fc9916b82c22;hb=HEAD;hp=ad5215f064acc5407b2d1bc48664c549c3e41fbb;hpb=638802eaf20d636c16d7ce337ace508708705f2c;p=alttp.git diff --git a/app/Models/User.php b/app/Models/User.php index ad5215f..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'; } @@ -190,6 +194,7 @@ class User extends Authenticatable protected $fillable = [ 'id', 'username', + 'discord_nickname', 'discriminator', 'email', 'avatar', @@ -225,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',