Sha256: a6d67bbbbfceb081b2f19f9c6e985df757c743a131f717683ede098affcb0657
Contents?: true
Size: 827 Bytes
Versions: 9
Compression:
Stored size: 827 Bytes
Contents
module Worthwhile module Ability extend ActiveSupport::Concern included do self.ability_logic += [:worthwhile_permissions] end def worthwhile_permissions 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 # Add this to your ability_logic if you want all logged in users to be able to submit content def everyone_can_create_curation_concerns unless current_user.new_record? can :create, [Worthwhile.configuration.curation_concerns] can :create, Collection end end end end
Version data entries
9 entries across 9 versions & 2 rubygems