Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2019-04-05 16:02:56 +0300
committerAndreas Brandl <abrandl@gitlab.com>2019-04-05 16:02:56 +0300
commit46b1b9c1d61c269588bd3cd4203420608ddd7f0b (patch)
treea877f5366d3367e1264e96f3f5e8a4b23bdbd62a /lib/gitlab/external_authorization.rb
parent7a48a06cf3b454021aa466464686fee8c82d6862 (diff)
Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"
This reverts merge request !26823
Diffstat (limited to 'lib/gitlab/external_authorization.rb')
-rw-r--r--lib/gitlab/external_authorization.rb40
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/gitlab/external_authorization.rb b/lib/gitlab/external_authorization.rb
deleted file mode 100644
index 25f8b7b3628..00000000000
--- a/lib/gitlab/external_authorization.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module ExternalAuthorization
- extend ExternalAuthorization::Config
-
- RequestFailed = Class.new(StandardError)
-
- def self.access_allowed?(user, label, project_path = nil)
- return true unless perform_check?
- return false unless user
-
- access_for_user_to_label(user, label, project_path).has_access?
- end
-
- def self.rejection_reason(user, label)
- return unless enabled?
- return unless user
-
- access_for_user_to_label(user, label, nil).reason
- end
-
- def self.access_for_user_to_label(user, label, project_path)
- if RequestStore.active?
- RequestStore.fetch("external_authorisation:user-#{user.id}:label-#{label}") do
- load_access(user, label, project_path)
- end
- else
- load_access(user, label, project_path)
- end
- end
-
- def self.load_access(user, label, project_path)
- access = ::Gitlab::ExternalAuthorization::Access.new(user, label).load!
- ::Gitlab::ExternalAuthorization::Logger.log_access(access, project_path)
-
- access
- end
- end
-end