role_policy.rb 267 B

123456789101112131415
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class RolePolicy < ApplicationPolicy
  3. def show?
  4. return true if admin?
  5. user.role_ids.include? record.id
  6. end
  7. private
  8. def admin?
  9. user.permissions?('admin.role')
  10. end
  11. end