diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-10 16:48:08 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-10 16:48:08 +0400 |
commit | daa7f077db81f3ecc3417419b7f74b157bb3fda3 (patch) | |
tree | cd11e3d94fe0f9ef6374d1f7f6e19b4b42be9e37 /lib/gitlab/ldap/access.rb | |
parent | 0142aa5a34eaf5e7425a1d8b5087606471d1fa33 (diff) |
Port LDAP code from EE
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/gitlab/ldap/access.rb')
-rw-r--r-- | lib/gitlab/ldap/access.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/ldap/access.rb b/lib/gitlab/ldap/access.rb new file mode 100644 index 00000000000..5ca240257bc --- /dev/null +++ b/lib/gitlab/ldap/access.rb @@ -0,0 +1,17 @@ +#------------------------------------------------------------------- +# +# 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 |