list.rb 381 B

1234567891011
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Service::Ticket::Article::List < Service::BaseWithCurrentUser
  3. def execute(ticket:)
  4. if TicketPolicy.new(current_user, ticket).agent_read_access?
  5. ::Ticket::Article.where(ticket:).reorder(:id)
  6. else
  7. ::Ticket::Article.where(ticket:, internal: false).reorder(:id)
  8. end
  9. end
  10. end