This commit is contained in:
Stella Rouzi 2014-08-13 14:37:15 +03:00
parent 1cbf78df3d
commit aeb28833f1
8 changed files with 39 additions and 30 deletions

View file

@ -99,8 +99,8 @@ class Ability
can :manage, SponsorshipLevel, conference_id: conf_ids_for_organizer
can :manage, SupporterLevel, conference_id: conf_ids_for_organizer
can :manage, Target, conference_id: conf_ids_for_organizer
can :manage, Commercial # , commercialable_type: 'Conference', commercialable_id: conf_ids_for_organizer
can :index, Commercial, commercialable_type: 'Conference'
can :manage, Commercial, commercialable_type: 'Conference', commercialable_id: conf_ids_for_organizer
# Manage commercials for events that belong to a conference of which user is organizer
can :manage, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(conference_id: conf_ids_for_organizer + conf_ids_for_cfp).pluck(:id)
can :manage, Contact, conference_id: conf_ids_for_organizer
@ -114,6 +114,8 @@ class Ability
conference.make_conference_public == true
end
# see commercials too
can :show, Event do |event|
event.state == 'confirmed'
end