2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2021-05-25 12:30:12 +00:00
|
|
|
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
|
2021-06-23 11:35:27 +00:00
|
|
|
::Group.all.pluck(:id).index_with do
|
|
|
|
'full'.freeze
|
2021-05-25 12:30:12 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|