user_roles.rb 543 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer::Unit::Import::Ldap::Users::UserRoles < Sequencer::Unit::Base
  3. uses :ldap_config, :ldap_connection
  4. provides :dn_roles
  5. def process
  6. state.provide(:dn_roles) do
  7. group_config = {
  8. filter: ldap_config[:group_filter],
  9. user_filter: ldap_config[:user_filter],
  10. }
  11. ldap_group = ::Ldap::Group.new(group_config, ldap: ldap_connection)
  12. ldap_group.user_roles(ldap_config[:group_role_map])
  13. end
  14. end
  15. end