1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-09 09:57:23 +03:00

B #-: Fix ldap_auth if group_admin_group_dn is nil (#2403)

As in ruby 2.0
irb(main):001:0> 'a'.casecmp(nil)
TypeError: no implicit conversion of nil into String
This commit is contained in:
Jan Orel 2022-12-07 09:15:41 +01:00 committed by GitHub
parent 0b7d36df7f
commit 3355250205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,7 +213,7 @@ class OpenNebula::LdapAuth
groups = []
ldap_groups.each do |group|
if (g = in_hash_ignore_case?(@mapping, group))
if ldap_groups.any? {
if !@options[:group_admin_group_dn].nil? and ldap_groups.any? {
|s| s.casecmp(@options[:group_admin_group_dn])==0
}
groups << "*#{@mapping[g]}"