ticket_checklist_items_controller_policy.rb 541 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Controllers::TicketChecklistItemsControllerPolicy < Controllers::ApplicationControllerPolicy
  3. def create?
  4. update_access_via_ticket?
  5. end
  6. def destroy?
  7. update_access_via_ticket?
  8. end
  9. def update?
  10. update_access_via_ticket?
  11. end
  12. private
  13. def ticket_policy
  14. @ticket_policy ||= TicketPolicy.new(user, Ticket.lookup(id: record.params[:ticket_id]))
  15. end
  16. def update_access_via_ticket?
  17. ticket_policy.agent_update_access?
  18. end
  19. end