diff options
author | Jean Praloran <jeanpralo@gmail.com> | 2017-03-17 11:19:12 +1300 |
---|---|---|
committer | Jean Praloran <jeanpralo@gmail.com> | 2017-05-30 07:11:28 +1200 |
commit | 6c9da292418c606aefe34aab40923d5730ae9aa5 (patch) | |
tree | 3d43e60bfd89075964df208dedca4ce3d3b0c191 /app/services/auth | |
parent | 8ef46b9f46711145496da4b3e64b0b7ace80c2ad (diff) | |
download | gitlab-ce-6c9da292418c606aefe34aab40923d5730ae9aa5.tar.gz |
add test and rebase
Diffstat (limited to 'app/services/auth')
-rw-r--r-- | app/services/auth/container_registry_authentication_service.rb | 7 |
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) |