time_accounting_policy.rb 390 B

1234567891011121314151617
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Ticket::TimeAccountingPolicy < ApplicationPolicy
  3. def create?
  4. if !Setting.get 'time_accounting'
  5. return not_authorized __('Time Accounting is not enabled')
  6. end
  7. ticket_update_access?
  8. end
  9. private
  10. def ticket_update_access?
  11. TicketPolicy.new(user, record.ticket).update?
  12. end
  13. end