Skip to content

Commit d29f991

Browse files
committed
Downcase group classes to match Net::LDAP behavior
1 parent 68b2451 commit d29f991

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/github/ldap/group.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ def member_names
7272
# Internal - Check if an object class includes the member names
7373
# Use `&` rathen than `include?` because both are arrays.
7474
#
75+
# NOTE: object classes are downcased by default in Net::LDAP, so this
76+
# will fail to match correctly unless we also downcase our group classes.
77+
#
7578
# Returns true if the object class includes one of the group class names.
7679
def group?(object_class)
77-
!(GROUP_CLASS_NAMES & object_class).empty?
80+
!(GROUP_CLASS_NAMES.map(&:downcase) & object_class.map(&:downcase)).empty?
7881
end
7982

8083
# Internal - Generate a hash with all the group DNs for caching purposes.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy