checklist.rb 595 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Queries
  3. class Ticket::Checklist < BaseQuery
  4. include Gql::Concerns::EnsuresChecklistFeatureActive
  5. description 'Fetch ticket checklist'
  6. argument :ticket, Gql::Types::Input::Locator::TicketInputType, description: 'Ticket locator'
  7. type Gql::Types::ChecklistType, null: true
  8. def self.authorize(_obj, ctx)
  9. ensure_checklist_feature_active!
  10. ctx.current_user.permissions?(['ticket.agent'])
  11. end
  12. def resolve(ticket:)
  13. ::Checklist.find_by(ticket:)
  14. end
  15. end
  16. end