31 lines
798 B
Ruby
31 lines
798 B
Ruby
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
class Sequencer
|
|
class Unit
|
|
module Import
|
|
module Freshdesk
|
|
class Agents < Sequencer::Unit::Import::Freshdesk::SubSequence::Object
|
|
class GroupsPermissions < Sequencer::Unit::Base
|
|
|
|
def process
|
|
::Role.find_by(name: 'Agent').users.each do |user|
|
|
user.group_ids_access_map = group_ids_access_map
|
|
user.save!
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def group_ids_access_map
|
|
@group_ids_access_map ||= begin
|
|
::Group.all.pluck(:id).index_with do
|
|
'full'.freeze
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|