Module: Worthwhile::Ability
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/worthwhile/ability.rb
Instance Method Summary collapse
-
#everyone_can_create_curation_concerns ⇒ Object
Add this to your ability_logic if you want all logged in users to be able to submit content.
- #worthwhile_permissions ⇒ Object
Instance Method Details
#everyone_can_create_curation_concerns ⇒ Object
Add this to your ability_logic if you want all logged in users to be able to submit content
24 25 26 27 28 29 |
# File 'app/models/concerns/worthwhile/ability.rb', line 24 def everyone_can_create_curation_concerns unless current_user.new_record? can :create, [Worthwhile.configuration.curation_concerns] can :create, Collection end end |
#worthwhile_permissions ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/models/concerns/worthwhile/ability.rb', line 8 def unless current_user.new_record? can :create, Worthwhile::ClassifyConcern can :create, [Worthwhile::GenericFile, Worthwhile::LinkedResource] end if user_groups.include? 'admin' can [:discover, :show, :read, :edit, :update, :destroy], :all end can :collect, :all end |