Skip to content
Snippets Groups Projects
Commit 17970cf5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'ldap-fixes' into 'master'

Ldap fixes

Will fix #193 by adding a proper active_directory check

See merge request !206
parents 878dfdbc 7389ab15
No related branches found
No related tags found
3 merge requests!8889WIP: Port of 25624-anticipate-obstacles-to-removing-turbolinks to EE.,!7795Asciidoctor plantuml,!7793Add support for PlantUML diagrams in Asciidoc.
module Gitlab
module LDAP
class Group
attr_accessor :adapter
def self.find_by_cn(cn, adapter)
adapter.group(cn)
end
Loading
Loading
@@ -36,7 +38,7 @@ module Gitlab
member_uids.include?(user.uid)
elsif member_dns.include?(user.dn)
true
elsif Gitlab.config.ldap.active_directory
elsif adapter.config.active_directory
adapter.dn_matches_filter?(user.dn, active_directory_recursive_memberof_filter)
end
end
Loading
Loading
Loading
Loading
@@ -261,8 +261,8 @@ objectclass: posixGroup
describe 'ldap_groups' do
let(:ldap_group_1) do
Net::LDAP::Entry.from_single_ldif_string(
%Q{dn: cn=#{Gitlab.config.ldap['admin_group']},ou=groups,dc=bar,dc=com
cn: #{Gitlab.config.ldap['admin_group']}
%Q{dn: cn=#{access.ldap_config.admin_group},ou=groups,dc=bar,dc=com
cn: #{access.ldap_config.admin_group}
description: GitLab group 1
gidnumber: 42
memberuid: user1
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment