scope.rb 335 B

123456789101112
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Ticket::SharedDraftStartPolicy < ApplicationPolicy
  3. class Scope < ApplicationPolicy::Scope
  4. def resolve
  5. scope.none if !user.permissions?(['ticket.agent'])
  6. scope.where group_id: user.groups_access('change').map(&:id)
  7. end
  8. end
  9. end