From b57c771d3e760e9db8b58cb3f98152c315501cf1 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 5 Mar 2019 21:00:38 +0100 Subject: [PATCH] Allow viewing the schedule/events in ichain mode This abilit is not specific to one mode. --- app/models/ability.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 23eba7a7..4ae77007 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -31,6 +31,10 @@ class Ability event.state == 'confirmed' end + can [:show, :events], Schedule do |schedule| + schedule.program.schedule_public + end + # can view Commercials of confirmed Events can :show, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(state: 'confirmed').pluck(:id) can [:show, :create], User @@ -52,10 +56,6 @@ class Ability event.program.cfp_open? && event.new_record? end - can [:show, :events], Schedule do |schedule| - schedule.program.schedule_public - end - can [:index, :show], Survey, surveyable_type: 'Conference' end end