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
|
|
|
|
2017-11-29 16:54:52 +00:00
|
|
|
class Sequencer
|
|
|
|
class Unit
|
|
|
|
module Import
|
|
|
|
module Ldap
|
|
|
|
module Users
|
|
|
|
class UserRoles < Sequencer::Unit::Base
|
|
|
|
uses :ldap_config, :ldap_connection
|
|
|
|
provides :dn_roles
|
|
|
|
|
|
|
|
def process
|
|
|
|
|
|
|
|
state.provide(:dn_roles) do
|
|
|
|
|
|
|
|
group_config = {
|
|
|
|
filter: ldap_config[:group_filter]
|
|
|
|
}
|
|
|
|
|
|
|
|
ldap_group = ::Ldap::Group.new(group_config, ldap: ldap_connection)
|
|
|
|
|
|
|
|
ldap_group.user_roles(ldap_config[:group_role_map])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|