tickets_shared_draft_starts_controller_policy.rb 578 B

123456789101112131415161718192021222324252627282930313233
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Controllers::TicketsSharedDraftStartsControllerPolicy < Controllers::ApplicationControllerPolicy
  3. def index?
  4. access?(__method__)
  5. end
  6. def show?
  7. access?(__method__)
  8. end
  9. def create?
  10. access?(__method__)
  11. end
  12. def update?
  13. access?(__method__)
  14. end
  15. def destroy?
  16. access?(__method__)
  17. end
  18. def import_attachments?
  19. access?(__method__)
  20. end
  21. private
  22. def access?(_method)
  23. user.permissions?('ticket.agent') && user.groups.access(:create).any?
  24. end
  25. end