summaryrefslogtreecommitdiff
path: root/app/services/auth
diff options
context:
space:
mode:
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)