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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
8476516e
Commit
8476516e
authored
Jul 28, 2019
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate private methods under the keyword on projects controller
parent
f52e9d55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+12
-10
No files found.
app/controllers/projects_controller.rb
View file @
8476516e
...
...
@@ -284,6 +284,18 @@ class ProjectsController < Projects::ApplicationController
end
# rubocop: enable CodeReuse/ActiveRecord
def
resolve
@project
=
Project
.
find
(
params
[
:id
])
if
can?
(
current_user
,
:read_project
,
@project
)
redirect_to
@project
else
render_404
end
end
private
# Render project landing depending of which features are available
# So if page is not available in the list it renders the next page
#
...
...
@@ -453,14 +465,4 @@ class ProjectsController < Projects::ApplicationController
def
present_project
@project
=
@project
.
present
(
current_user:
current_user
)
end
def
resolve
@project
=
Project
.
find
(
params
[
:id
])
if
can?
(
current_user
,
:read_project
,
@project
)
redirect_to
@project
else
render_404
end
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