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:
Diffstat (limited to 'lib/gitlab/auth.rb')
-rw-r--r--lib/gitlab/auth.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index 7aa02009aa0..a60f8cea27c 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -169,18 +169,6 @@ module Gitlab
AccessTokenValidationService.new(token).include_any_scope?(scopes)
end
- def abilities_for_scopes(scopes)
- abilities_by_scope = {
- api: full_authentication_abilities,
- read_registry: [:read_container_image],
- read_repository: [:download_code]
- }
-
- scopes.flat_map do |scope|
- abilities_by_scope.fetch(scope.to_sym, [])
- end.uniq
- end
-
# rubocop: disable CodeReuse/ActiveRecord
def deploy_token_check(login, password)
return unless password.present?
@@ -246,6 +234,18 @@ module Gitlab
public
+ def abilities_for_scopes(scopes)
+ abilities_by_scope = {
+ api: full_authentication_abilities,
+ read_registry: [:read_container_image],
+ read_repository: [:download_code]
+ }
+
+ scopes.flat_map do |scope|
+ abilities_by_scope.fetch(scope.to_sym, [])
+ end.uniq
+ end
+
def build_authentication_abilities
[
:read_project,