summaryrefslogtreecommitdiff
path: root/app/helpers/auth_helper.rb
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2017-03-28 11:33:51 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2017-03-31 18:42:34 +0100
commitb9adf92f3c96d5f24fa413944dff3b932740a613 (patch)
treeebb38fe8bfadf720dc1fc4948f5f7fde3749ba2c /app/helpers/auth_helper.rb
parent19a4403443ff6217e6a024667f8ef1eea2f38f4a (diff)
downloadgitlab-ce-b9adf92f3c96d5f24fa413944dff3b932740a613.tar.gz
Prevent users from disconnecting gitlab account from CAS
Diffstat (limited to 'app/helpers/auth_helper.rb')
-rw-r--r--app/helpers/auth_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/auth_helper.rb b/app/helpers/auth_helper.rb
index 1ee6c1d3afa..101fe579da2 100644
--- a/app/helpers/auth_helper.rb
+++ b/app/helpers/auth_helper.rb
@@ -76,5 +76,9 @@ module AuthHelper
(current_user.otp_grace_period_started_at + current_application_settings.two_factor_grace_period.hours) < Time.current
end
+ def unlink_allowed?(provider)
+ %w(saml cas3).exclude?(provider.to_s)
+ end
+
extend self
end