signature_policy.rb 477 B

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class SignaturePolicy < ApplicationPolicy
  3. def show?
  4. return true if admin?
  5. return true if user.permissions?('ticket.agent') && record.active
  6. false
  7. end
  8. def create?
  9. admin?
  10. end
  11. def update?
  12. admin?
  13. end
  14. def destroy?
  15. admin?
  16. end
  17. private
  18. def admin?
  19. user.permissions?(['admin.channel_email', 'admin.channel_google', 'admin.channel_microsoft365'])
  20. end
  21. end