trabajo-afectivo/app/policies/ticket/shared_draft_start_policy/scope.rb

13 lines
335 B
Ruby
Raw Permalink Normal View History

2022-02-24 11:33:52 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class Ticket::SharedDraftStartPolicy < ApplicationPolicy
class Scope < ApplicationPolicy::Scope
def resolve
scope.none if !user.permissions?(['ticket.agent'])
scope.where group_id: user.groups.access('change').map(&:id)
end
end
end