BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
64aa9e21
Commit
64aa9e21
authored
Aug 07, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain 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
parent
fa5575cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
container_registry_authentication_service.rb
...ervices/auth/container_registry_authentication_service.rb
+2
-2
container_registry_authentication_service_spec.rb
...es/auth/container_registry_authentication_service_spec.rb
+1
-1
No files found.
app/services/auth/container_registry_authentication_service.rb
View file @
64aa9e21
...
...
@@ -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
...
...
spec/services/auth/container_registry_authentication_service_spec.rb
View file @
64aa9e21
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment