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:
authorJean Praloran <jeanpralo@gmail.com>2017-03-17 01:19:12 +0300
committerJean Praloran <jeanpralo@gmail.com>2017-05-29 22:11:28 +0300
commit6c9da292418c606aefe34aab40923d5730ae9aa5 (patch)
tree3d43e60bfd89075964df208dedca4ce3d3b0c191 /app/services/auth
parent8ef46b9f46711145496da4b3e64b0b7ace80c2ad (diff)
add test and rebase
Diffstat (limited to 'app/services/auth')
-rw-r--r--app/services/auth/container_registry_authentication_service.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/services/auth/container_registry_authentication_service.rb b/app/services/auth/container_registry_authentication_service.rb
index 99a3d9c2cf9..335cfdbc231 100644
--- a/app/services/auth/container_registry_authentication_service.rb
+++ b/app/services/auth/container_registry_authentication_service.rb
@@ -104,7 +104,7 @@ module Auth
when 'push'
build_can_push?(requested_project) || user_can_push?(requested_project)
when '*'
- requested_project == project || can?(current_user, :admin_container_image, requested_project)
+ user_can_delete?(requested_project)
else
false
end
@@ -122,6 +122,11 @@ module Auth
(requested_project == project || can?(current_user, :build_read_container_image, requested_project))
end
+ def user_can_delete(requested_project)
+ has_authentication_ability?(:admin_container_image) &&
+ can?(current_user, :admin_container_image, requested_project)
+ end
+
def user_can_pull?(requested_project)
has_authentication_ability?(:read_container_image) &&
can?(current_user, :read_container_image, requested_project)