Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
98a7486b
Commit
98a7486b
authored
May 18, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify if registry is enabled in registry
parent
2f1cb7ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
app/controllers/projects/container_registry_controller.rb
app/controllers/projects/container_registry_controller.rb
+5
-0
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
No files found.
app/controllers/projects/container_registry_controller.rb
View file @
98a7486b
class
Projects::ContainerRegistryController
<
Projects
::
ApplicationController
class
Projects::ContainerRegistryController
<
Projects
::
ApplicationController
before_action
:verify_registry_enabled
before_action
:authorize_read_container_image!
before_action
:authorize_read_container_image!
before_action
:authorize_update_container_image!
,
only:
[
:destroy
]
before_action
:authorize_update_container_image!
,
only:
[
:destroy
]
layout
'project'
layout
'project'
...
@@ -19,6 +20,10 @@ class Projects::ContainerRegistryController < Projects::ApplicationController
...
@@ -19,6 +20,10 @@ class Projects::ContainerRegistryController < Projects::ApplicationController
private
private
def
verify_registry_enabled
render_404
unless
Gitlab
.
config
.
registry
.
enabled
end
def
container_registry_repository
def
container_registry_repository
@container_registry_repository
||=
project
.
container_registry_repository
@container_registry_repository
||=
project
.
container_registry_repository
end
end
...
...
app/helpers/projects_helper.rb
View file @
98a7486b
...
@@ -152,7 +152,7 @@ module ProjectsHelper
...
@@ -152,7 +152,7 @@ module ProjectsHelper
nav_tabs
<<
:builds
nav_tabs
<<
:builds
end
end
if
project
.
container_registry_repository_url
.
present?
&&
can?
(
current_user
,
:read_container_image
,
project
)
if
Gitlab
.
config
.
registry
.
enabled
&&
can?
(
current_user
,
:read_container_image
,
project
)
nav_tabs
<<
:container_registry
nav_tabs
<<
:container_registry
end
end
...
...
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