scope.rb 365 B

1234567891011121314151617
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class TemplatePolicy < ApplicationPolicy
  3. class Scope < ApplicationPolicy::Scope
  4. def resolve
  5. if user.permissions?('admin.template')
  6. scope.all
  7. elsif user.permissions?('ticket.agent')
  8. scope.active
  9. else
  10. scope.none
  11. end
  12. end
  13. end
  14. end