Minor changes

This commit is contained in:
Rishabh Singh 2019-07-23 01:39:48 +05:30
parent 58208c73ac
commit 6a8aca6095
5 changed files with 29 additions and 29 deletions

View file

@ -155,17 +155,20 @@ 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, Comment
# 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)
can :index, Comment, commentable_type: 'Event',
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
can :index, Comment, commentable_type: 'Track',
commentable_id: Track.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
end
if conf_ids_for_cfp
# To access comment link in menu bar
can :manage, Comment
# can :index, Comment, commentable_type: 'Event',
# commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
can :index, Comment, commentable_type: 'Event',
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
can :index, Comment, commentable_type: 'Track',
commentable_id: Track.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
# To access conference/proposals
can :manage, Event, program: { conference_id: conf_ids_for_cfp }
end

View file

@ -193,7 +193,7 @@ class AdminAbility
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
can :index, Comment, commentable_type: 'Track',
commentable_id: Track.where(program_id: Program.where(conference_id: conf_ids).pluck(:id)).pluck(:id)
commentable_id: Track.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
# Abilities for Role (Conference resource)
can [:index, :show], Role do |role|
role.resource_type == 'Conference' || role.resource_type == 'Track'