text_module_policy.rb 384 B

12345678910111213141516
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class TextModulePolicy < ApplicationPolicy
  3. def show?
  4. return true if user.permissions?('admin.text_module')
  5. return false if !user.permissions?('ticket.agent')
  6. if record.group_ids.any?
  7. return record.group_ids.intersection(user.group_ids_access('read')).any?
  8. end
  9. true
  10. end
  11. end