diff options
author | Reverite <github@reverite.sh> | 2019-06-26 20:31:07 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-06-26 20:31:07 -0700 |
commit | 3fa90982efda2109ddf90d81f5ed3449f8282642 (patch) | |
tree | e5514f4c72c9ffb44059a2afb7fdf24d0348bbd4 /app/models/concerns/user_roles.rb | |
parent | 714940de498e93a8bf40dcda1835217df18741bf (diff) | |
parent | 9ef25877dfda12cf31ec586294e4d4908f5be4f0 (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/models/concerns/user_roles.rb')
-rw-r--r-- | app/models/concerns/user_roles.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/concerns/user_roles.rb b/app/models/concerns/user_roles.rb index 58dffdc46..a42b4a172 100644 --- a/app/models/concerns/user_roles.rb +++ b/app/models/concerns/user_roles.rb @@ -13,6 +13,20 @@ module UserRoles admin? || moderator? end + def role=(value) + case value + when 'admin' + self.admin = true + self.moderator = false + when 'moderator' + self.admin = false + self.moderator = true + else + self.admin = false + self.moderator = false + end + end + def role if admin? 'admin' |