gitlab-org--gitlab-foss/lib/gitlab/user_access.rb
Jacob Vosmaer 82dc40936a Cache LDAP check in Gitlab::UserAccess
This changes the number of LDAP calls when users access GitLab via
Git-over-SSH or the API. LDAP check results are cached for 1 hour.
2014-08-06 18:03:01 +02:00

13 lines
238 B
Ruby

module Gitlab
module UserAccess
def self.allowed?(user)
return false if user.blocked?
if user.requires_ldap_check?
return false unless Gitlab::LDAP::Access.allowed?(user)
end
true
end
end
end