diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2019-07-29 12:37:36 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-07-29 12:37:36 +0300 |
commit | 77926ea02512d836c61a30e3986902e2d8e7f886 (patch) | |
tree | b150a5852bf8dde7696f01f94b72fed59a03520d | |
parent | e2ce23267aecf0bd3eb88106234fd8b9a9681ed1 (diff) | |
parent | 8476516e3db8575da52b0e3ae271064ad098ead0 (diff) |
Merge branch 'projects-controller-private' into 'master'
Separate private methods under the keyword on projects controller
See merge request gitlab-org/gitlab-ce!31223
-rw-r--r-- | app/controllers/projects_controller.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 37ffd28bf9e..d4ff72c2314 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -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 |