diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-08-07 12:29:34 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-08-07 12:29:34 +0300 |
commit | 64aa9e21b254e1f03e55d359e8fe9a349c660b43 (patch) | |
tree | cf7de617c032c8abad0eea1d696d1d9d2d3c3d8a /app/services/auth | |
parent | fa5575cf4b37c50d1e757e7ef1fcc3172ac6c1a5 (diff) |
Rename user_can_admin? because it's more accurate
Also fix the test because we no longer have :empty_project,
just use :project is the same as before
Diffstat (limited to 'app/services/auth')
-rw-r--r-- | app/services/auth/container_registry_authentication_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/auth/container_registry_authentication_service.rb b/app/services/auth/container_registry_authentication_service.rb index 9622ce64d9f..7dae5880931 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 '*' - user_can_delete?(requested_project) + user_can_admin?(requested_project) else false end @@ -122,7 +122,7 @@ module Auth (requested_project == project || can?(current_user, :build_read_container_image, requested_project)) end - def user_can_delete?(requested_project) + def user_can_admin?(requested_project) has_authentication_ability?(:admin_container_image) && can?(current_user, :admin_container_image, requested_project) end |