scope.rb 321 B

1234567891011121314
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class UserPolicy < ApplicationPolicy
  3. class Scope < ApplicationPolicy::Scope
  4. def resolve
  5. if user.permissions?(['ticket.agent', 'admin.user'])
  6. scope.all
  7. else
  8. scope.where(id: user.id)
  9. end
  10. end
  11. end
  12. end