2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-07-20 17:35:02 +00:00
|
|
|
|
|
|
|
class UserPolicy < ApplicationPolicy
|
|
|
|
class Scope < ApplicationPolicy::Scope
|
|
|
|
|
|
|
|
def resolve
|
|
|
|
if user.permissions?(['ticket.agent', 'admin.user'])
|
|
|
|
scope.all
|
|
|
|
else
|
|
|
|
scope.where(id: user.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|