Skip to content
Snippets Groups Projects
Commit 4407d3cf authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

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.
parent 313e35e8
No related branches found
No related tags found
1 merge request!10109Multi-level container registry images
Pipeline #
Loading
@@ -107,6 +107,11 @@ module Auth
Loading
@@ -107,6 +107,11 @@ module Auth
can?(current_user, :read_container_image, requested_project) can?(current_user, :read_container_image, requested_project)
end 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) def build_can_push?(requested_project)
# Build can push only to the project from which it originates # Build can push only to the project from which it originates
has_authentication_ability?(:build_create_container_image) && has_authentication_ability?(:build_create_container_image) &&
Loading
@@ -119,14 +124,11 @@ module Auth
Loading
@@ -119,14 +124,11 @@ module Auth
end end
   
def error(code, status:, message: '') def error(code, status:, message: '')
{ { errors: [{ code: code, message: message }], http_status: status }
errors: [{ code: code, message: message }],
http_status: status
}
end end
   
def has_authentication_ability?(capability) def has_authentication_ability?(capability)
(@authentication_abilities || []).include?(capability) @authentication_abilities.to_a.include?(capability)
end end
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment