Remove unnecessary ability from adminAbilities

CanCanCan can load @events and @event in EventsController by itself
This commit is contained in:
AEtherC0r3 2017-08-09 12:05:11 +03:00 committed by Stella Rouzi
parent c4eec6a3de
commit a87c6e55f7
4 changed files with 4 additions and 19 deletions

View file

@ -39,10 +39,6 @@ class AdminAbility
event.program.cfp_open? && event.new_record?
end
can [:update, :show, :index], Event do |event|
event.users.include?(user)
end
# can manage the commercials of their own events
can :manage, Commercial, commercialable_type: 'Event', commercialable_id: user.events.pluck(:id)