summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-08-07 17:29:34 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-08-07 17:29:34 +0800
commit64aa9e21b254e1f03e55d359e8fe9a349c660b43 (patch)
treecf7de617c032c8abad0eea1d696d1d9d2d3c3d8a
parentfa5575cf4b37c50d1e757e7ef1fcc3172ac6c1a5 (diff)
downloadgitlab-ce-add-star-for-action-scope.tar.gz
Rename user_can_admin? because it's more accurateadd-star-for-action-scope
Also fix the test because we no longer have :empty_project, just use :project is the same as before
-rw-r--r--app/services/auth/container_registry_authentication_service.rb4
-rw-r--r--spec/services/auth/container_registry_authentication_service_spec.rb2
2 files changed, 3 insertions, 3 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
diff --git a/spec/services/auth/container_registry_authentication_service_spec.rb b/spec/services/auth/container_registry_authentication_service_spec.rb
index 0e7d802e336..1c2d0b3e0dc 100644
--- a/spec/services/auth/container_registry_authentication_service_spec.rb
+++ b/spec/services/auth/container_registry_authentication_service_spec.rb
@@ -315,7 +315,7 @@ describe Auth::ContainerRegistryAuthenticationService do
end
context 'delete authorized as master' do
- let(:current_project) { create(:empty_project) }
+ let(:current_project) { create(:project) }
let(:current_user) { create(:user) }
let(:authentication_abilities) do