From b9adf92f3c96d5f24fa413944dff3b932740a613 Mon Sep 17 00:00:00 2001 From: Tiago Botelho Date: Tue, 28 Mar 2017 11:33:51 +0100 Subject: Prevent users from disconnecting gitlab account from CAS --- app/helpers/auth_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/helpers') 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 -- cgit v1.2.3