diff options
Diffstat (limited to 'app/models/user.rb')
| -rw-r--r-- | app/models/user.rb | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 786f8d14..95706f86 100644 --- a/app/models/user.rb +++ b/app/models/user.rb | |||
| @@ -70,24 +70,6 @@ class User < ApplicationRecord | |||
| 70 | roles.include?("admin") | 70 | roles.include?("admin") |
| 71 | end | 71 | end |
| 72 | 72 | ||
| 73 | # Compatibility shims for the users form, which posts user[admin] as a | ||
| 74 | # checkbox. Goes away when that form learns about roles. | ||
| 75 | def admin | ||
| 76 | is_admin? | ||
| 77 | end | ||
| 78 | |||
| 79 | def admin? | ||
| 80 | is_admin? | ||
| 81 | end | ||
| 82 | |||
| 83 | def admin=(value) | ||
| 84 | if ActiveModel::Type::Boolean.new.cast(value) | ||
| 85 | self.roles = (roles | ["admin"]) | ||
| 86 | else | ||
| 87 | self.roles = (roles - ["admin"]) | ||
| 88 | end | ||
| 89 | end | ||
| 90 | |||
| 91 | def redaktion? | 73 | def redaktion? |
| 92 | roles.include?("redaktion") | 74 | roles.include?("redaktion") |
| 93 | end | 75 | end |
