gitlab-org--gitlab-foss/lib/gitlab/user_access.rb
2014-05-15 10:22:59 +02:00

18 lines
397 B
Ruby

module Gitlab
module UserAccess
def self.allowed?(user)
return false if user.blocked?
if Gitlab.config.ldap.enabled
if user.ldap_user?
# Check if LDAP user exists and match LDAP user_filter
Gitlab::LDAP::Access.open do |adapter|
return false unless adapter.allowed?(user)
end
end
end
true
end
end
end