app/models/concerns/spotlight/user.rb in blacklight-spotlight-0.0.3 vs app/models/concerns/spotlight/user.rb in blacklight-spotlight-0.1.0
- old
+ new
@@ -2,9 +2,13 @@
extend ActiveSupport::Concern
included do
has_many :roles, class_name: 'Spotlight::Role'
end
+ def superadmin?
+ admin_roles.where(exhibit_id: nil).any?
+ end
+
def admin_roles
roles.where(role: 'admin')
end
alias_attribute :user_key, :email