Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/github/ldap/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,19 @@ def member_names
end
end

# Internal: Returns true if the object class(es) provided match a group's.
def group?(object_class)
self.class.group?(object_class)
end

# Internal - Check if an object class includes the member names
# Use `&` rathen than `include?` because both are arrays.
#
# NOTE: object classes are downcased by default in Net::LDAP, so this
# will fail to match correctly unless we also downcase our group classes.
#
# Returns true if the object class includes one of the group class names.
def group?(object_class)
def self.group?(object_class)
!(GROUP_CLASS_NAMES.map(&:downcase) & object_class.map(&:downcase)).empty?
end

Expand Down