gitlab-org--gitlab-foss/lib/gitlab/ldap/access.rb
Dmitriy Zaporozhets daa7f077db
Port LDAP code from EE
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-03-10 14:48:08 +02:00

17 lines
401 B
Ruby

#-------------------------------------------------------------------
#
# Copyright (C) 2013 GitLab.com - Distributed under the MIT Expat License
#
#-------------------------------------------------------------------
module Gitlab
module LDAP
class Access
def allowed?(user)
!!Gitlab::LDAP::Person.find_by_dn(user.extern_uid)
rescue
false
end
end
end
end