mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
fix(auth): allow event commercial management
Non-admin proposal flow uses Ability, not AdminAbility, so organizers and CFP users could edit proposals but could not create event commercials. Closes #3143. Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
This commit is contained in:
parent
bd149ff255
commit
f66eb8393c
3 changed files with 89 additions and 0 deletions
|
|
@ -152,6 +152,8 @@ class Ability
|
|||
can :manage, Registration, conference_id: conf_ids_for_organizer
|
||||
# To access conference/proposals
|
||||
can :manage, Event, program: { conference_id: conf_ids_for_organizer }
|
||||
can :manage, Commercial, commercialable_type: 'Event',
|
||||
commercialable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
|
||||
# To access comment link in menu bar
|
||||
can :index, Comment, commentable_type: 'Event',
|
||||
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
|
||||
|
|
@ -163,6 +165,8 @@ class Ability
|
|||
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
|
||||
# To access conference/proposals
|
||||
can :manage, Event, program: { conference_id: conf_ids_for_cfp }
|
||||
can :manage, Commercial, commercialable_type: 'Event',
|
||||
commercialable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
|
||||
end
|
||||
|
||||
if conf_ids_for_info_desk
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue