Added the creator method to the user model (#14883)

This commit is contained in:
Nick Taylor 2021-10-01 15:30:11 -04:00 committed by GitHub
parent f1e02b389a
commit f91984d21b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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