Added the creator method to the user model (#14883)
This commit is contained in:
parent
f1e02b389a
commit
f91984d21b
1 changed files with 4 additions and 0 deletions
|
|
@ -347,6 +347,10 @@ class User < ApplicationRecord
|
|||
has_role?(:super_admin)
|
||||
end
|
||||
|
||||
def creator?
|
||||
has_role?(:creator)
|
||||
end
|
||||
|
||||
def any_admin?
|
||||
@any_admin ||= roles.where(name: ANY_ADMIN_ROLES).any?
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue