summaryrefslogtreecommitdiff
path: root/lib/gitlab/auth/ldap/user.rb
diff options
context:
space:
mode:
authorJose <jivanvl@hotmail.com>2018-04-30 17:00:16 -0500
committerJose <jivanvl@hotmail.com>2018-04-30 17:00:16 -0500
commitd3327e0dfacd27d547ffdb3b7f4a1a76c76ae281 (patch)
tree82019118f22877ec9135d45620c9dcf8acd0579e /lib/gitlab/auth/ldap/user.rb
parentf48f40bf267fd0f35ba09fd3b8f30e17c0789327 (diff)
parent2f7b71df7619768220657ed47c7737f4c3e19e90 (diff)
downloadgitlab-ce-d3327e0dfacd27d547ffdb3b7f4a1a76c76ae281.tar.gz
Merge branch 'master' into 44059-specify-variables-when-executing-a-manual-pipeline-from-the-ui
Diffstat (limited to 'lib/gitlab/auth/ldap/user.rb')
-rw-r--r--lib/gitlab/auth/ldap/user.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/auth/ldap/user.rb b/lib/gitlab/auth/ldap/user.rb
index 068212d9a21..922d0567d99 100644
--- a/lib/gitlab/auth/ldap/user.rb
+++ b/lib/gitlab/auth/ldap/user.rb
@@ -8,6 +8,8 @@ module Gitlab
module Auth
module LDAP
class User < Gitlab::Auth::OAuth::User
+ extend ::Gitlab::Utils::Override
+
class << self
def find_by_uid_and_provider(uid, provider)
identity = ::Identity.with_extern_uid(provider, uid).take
@@ -29,7 +31,8 @@ module Gitlab
self.class.find_by_uid_and_provider(auth_hash.uid, auth_hash.provider)
end
- def changed?
+ override :should_save?
+ def should_save?
gl_user.changed? || gl_user.identities.any?(&:changed?)
end
@@ -41,6 +44,10 @@ module Gitlab
Gitlab::Auth::LDAP::Access.allowed?(gl_user)
end
+ def valid_sign_in?
+ allowed? && super
+ end
+
def ldap_config
Gitlab::Auth::LDAP::Config.new(auth_hash.provider)
end