Allow the track organizer to manage events
He/She can manage the events of his/her tracks and their commercials
This commit is contained in:
parent
a87c6e55f7
commit
af7efdb6fe
4 changed files with 34 additions and 9 deletions
|
|
@ -298,5 +298,14 @@ class AdminAbility
|
|||
can :toggle_user, Role do |role|
|
||||
role.resource_type == 'Track' && track_ids_for_track_organizer.include?(role.resource_id)
|
||||
end
|
||||
|
||||
# Show Events in the admin sidebar
|
||||
can :update, Event do |event|
|
||||
event.new_record? && conf_ids_for_track_organizer.include?(event.program.conference_id)
|
||||
end
|
||||
|
||||
can :manage, Event, track_id: track_ids_for_track_organizer
|
||||
can :manage, Commercial, commercialable_type: 'Event',
|
||||
commercialable_id: Event.where(track_id: track_ids_for_track_organizer).pluck(:id)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue