mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add routes and controller to scan Qr code
Added TicketScanning controller and routes to scan qr code on PhysicalTickets. Added test for the same
This commit is contained in:
parent
e2bad46d00
commit
1391668c0f
4 changed files with 85 additions and 0 deletions
|
|
@ -145,6 +145,10 @@ class AdminAbility
|
|||
can :manage, Sponsor, conference_id: conf_ids
|
||||
can :manage, SponsorshipLevel, conference_id: conf_ids
|
||||
can :manage, Ticket, conference_id: conf_ids
|
||||
can :create, TicketScanning do |ticket_scanning|
|
||||
conf_id = ticket_scanning.physical_ticket.ticket_purchase.conference_id
|
||||
conf_ids.include? conf_id
|
||||
end
|
||||
can :index, Comment, commentable_type: 'Event',
|
||||
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids).pluck(:id)).pluck(:id)
|
||||
|
||||
|
|
@ -220,6 +224,10 @@ class AdminAbility
|
|||
can :manage, Question do |question|
|
||||
!(question.conferences.pluck(:id) & conf_ids_for_info_desk).empty?
|
||||
end
|
||||
can :create, TicketScanning do |ticket_scanning|
|
||||
conf_id = ticket_scanning.physical_ticket.ticket_purchase.conference_id
|
||||
conf_ids_for_info_desk.include? conf_id
|
||||
end
|
||||
|
||||
# Abilities for Role (Conference resource)
|
||||
can [:index, :show], Role do |role|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue