Created
August 15, 2024 07:44
-
-
Save rolfschmidt/80f125c6e6281bac716b8d1bc71a26a5 to your computer and use it in GitHub Desktop.
User role mapping count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LdapSource.find_each do |source| | |
| ldap_config = source.preferences | |
| ldap_connection = ::Ldap.new(ldap_config) | |
| group_config = { | |
| filter: ldap_config[:group_filter] | |
| } | |
| ldap_group = ::Ldap::Group.new(group_config, ldap: ldap_connection) | |
| dn_roles = ldap_group.user_roles(ldap_config[:group_role_map]) | |
| puts "Matched count of #{dn_roles.count} for ldap source #{source.id}" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment