Sha256: 5a2f1df53fd9260ee78be9d55ba5ffe53c0103d27cf84b0adfd2c0789a3bc16a
Contents?: true
Size: 1.3 KB
Versions: 2
Compression:
Stored size: 1.3 KB
Contents
module Spotlight ## # Default Spotlight CanCan abilities module Ability include CanCan::Ability # rubocop:disable Metrics/AbcSize, Metrics/MethodLength def initialize(user) user ||= Spotlight::Engine.user_class.new alias_action :process_import, to: :import can :manage, :all if user.superadmin? # exhibit admin can [:update, :import, :export, :destroy], Spotlight::Exhibit, id: user.admin_roles.pluck(:exhibit_id) can :manage, [Spotlight::BlacklightConfiguration, Spotlight::Role], exhibit_id: user.admin_roles.pluck(:exhibit_id) can :manage, PaperTrail::Version if user.roles.any? # exhibit curator can :manage, [ Spotlight::Attachment, Spotlight::Search, Spotlight::Resource, Spotlight::Page, Spotlight::Contact, Spotlight::CustomField], exhibit_id: user.roles.pluck(:exhibit_id) can :manage, Spotlight::Lock, by: user can [:read, :curate, :tag], Spotlight::Exhibit, id: user.roles.pluck(:exhibit_id) # public can :read, Spotlight::HomePage can :read, Spotlight::Exhibit, published: true can :read, Spotlight::Page, published: true can :read, Spotlight::Search, published: true end # rubocop:enable Metrics/AbcSize, Metrics/MethodLength end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
blacklight-spotlight-0.13.0 | app/models/spotlight/ability.rb |
blacklight-spotlight-0.12.1 | app/models/spotlight/ability.rb |