Commit 3ced0cd7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Ignore ldap groups check if ldap.group_base setting is empty

parent ec21bf6c
...@@ -8,6 +8,10 @@ module Gitlab ...@@ -8,6 +8,10 @@ module Gitlab
module LDAP module LDAP
class Access class Access
def update_permissions(user) def update_permissions(user)
# Skip updating group permissions
# if instance does not use group_base setting
return true unless Gitlab.config.ldap['group_base'].present?
ldap_user = Gitlab::LDAP::Person.find(user.extern_uid) ldap_user = Gitlab::LDAP::Person.find(user.extern_uid)
ldap_groups = ldap_user.groups ldap_groups = ldap_user.groups
ldap_groups_cn = ldap_groups.map(&:name) ldap_groups_cn = ldap_groups.map(&:name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment