Add power_user? method to User model

This commit is contained in:
riggraz
2019-09-16 19:38:56 +02:00
parent 3c6e27be14
commit d05202a2d7
4 changed files with 14 additions and 6 deletions

View File

@@ -18,4 +18,8 @@ class User < ApplicationRecord
gravatar_id = Digest::MD5::hexdigest(email.downcase)
"https://secure.gravatar.com/avatar/#{gravatar_id}"
end
def power_user?
role == 'admin' || role == 'moderator'
end
end