ticket_shared_draft_zoom_controller_policy.rb 581 B

1234567891011121314151617181920212223242526272829303132
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Controllers::TicketSharedDraftZoomControllerPolicy < Controllers::ApplicationControllerPolicy
  3. def show?
  4. access?(__method__)
  5. end
  6. def create?
  7. access?(__method__)
  8. end
  9. def update?
  10. access?(__method__)
  11. end
  12. def destroy?
  13. access?(__method__)
  14. end
  15. def import_attachments?
  16. access?(__method__)
  17. end
  18. private
  19. def access?(_method)
  20. ticket_id = record.params[:ticket_id]
  21. ticket = Ticket.find ticket_id
  22. TicketPolicy.new(user, ticket).update?
  23. end
  24. end