summaryrefslogtreecommitdiff
path: root/app/services/auth
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-29 14:01:05 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-29 14:01:05 +0200
commit4407d3cf19bc815142ea3a7908003e85efde76ed (patch)
treecf565d7ff5cf5cff6c8c086276ee47c3787b30a9 /app/services/auth
parent313e35e817445271b68d40ab06f192f1d3e0ccf0 (diff)
downloadgitlab-ce-4407d3cf19bc815142ea3a7908003e85efde76ed.tar.gz
Add comment to container registry auth service
Comment explains why we still have authentication without user object there. The legacy authentication mechanism should be removed in 10.0.
Diffstat (limited to 'app/services/auth')
-rw-r--r--app/services/auth/container_registry_authentication_service.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/services/auth/container_registry_authentication_service.rb b/app/services/auth/container_registry_authentication_service.rb
index 7a2ec9664c1..b050f1dd51b 100644
--- a/app/services/auth/container_registry_authentication_service.rb
+++ b/app/services/auth/container_registry_authentication_service.rb
@@ -107,6 +107,11 @@ module Auth
can?(current_user, :read_container_image, requested_project)
end
+ ##
+ # We still support legacy pipeline triggers which do not have associated
+ # actor. New permissions model and new triggers are always associated with
+ # an actor, so this should be improved in 10.0 version of GitLab.
+ #
def build_can_push?(requested_project)
# Build can push only to the project from which it originates
has_authentication_ability?(:build_create_container_image) &&
@@ -119,14 +124,11 @@ module Auth
end
def error(code, status:, message: '')
- {
- errors: [{ code: code, message: message }],
- http_status: status
- }
+ { errors: [{ code: code, message: message }], http_status: status }
end
def has_authentication_ability?(capability)
- (@authentication_abilities || []).include?(capability)
+ @authentication_abilities.to_a.include?(capability)
end
end
end