@@ -160,6 +160,13 class ApplicationController < ActionController::Base | |||
|
160 | 160 | authorize(ctrl, action, global) |
|
161 | 161 | end |
|
162 | 162 | |
|
163 | # Find project of id params[:id] | |
|
164 | def find_project | |
|
165 | @project = Project.find(params[:id]) | |
|
166 | rescue ActiveRecord::RecordNotFound | |
|
167 | render_404 | |
|
168 | end | |
|
169 | ||
|
163 | 170 | # make sure that the user is a member of the project (or admin) if project is private |
|
164 | 171 | # used as a before_filter for actions that do not require any particular permission on the project |
|
165 | 172 | def check_project_privacy |
@@ -74,12 +74,6 class MembersController < ApplicationController | |||
|
74 | 74 | end |
|
75 | 75 | |
|
76 | 76 | private |
|
77 | def find_project | |
|
78 | @project = Project.find(params[:id]) | |
|
79 | rescue ActiveRecord::RecordNotFound | |
|
80 | render_404 | |
|
81 | end | |
|
82 | ||
|
83 | 77 | def find_member |
|
84 | 78 | @member = Member.find(params[:id]) |
|
85 | 79 | @project = @member.project |
@@ -413,15 +413,6 class ProjectsController < ApplicationController | |||
|
413 | 413 | end |
|
414 | 414 | |
|
415 | 415 | private |
|
416 | # Find project of id params[:id] | |
|
417 | # if not found, redirect to project list | |
|
418 | # Used as a before_filter | |
|
419 | def find_project | |
|
420 | @project = Project.find(params[:id]) | |
|
421 | rescue ActiveRecord::RecordNotFound | |
|
422 | render_404 | |
|
423 | end | |
|
424 | ||
|
425 | 416 | def find_optional_project |
|
426 | 417 | return true unless params[:id] |
|
427 | 418 | @project = Project.find(params[:id]) |
@@ -86,13 +86,6 class ReportsController < ApplicationController | |||
|
86 | 86 | end |
|
87 | 87 | |
|
88 | 88 | private |
|
89 | # Find project of id params[:id] | |
|
90 | def find_project | |
|
91 | @project = Project.find(params[:id]) | |
|
92 | rescue ActiveRecord::RecordNotFound | |
|
93 | render_404 | |
|
94 | end | |
|
95 | ||
|
96 | 89 | def issues_by_tracker |
|
97 | 90 | @issues_by_tracker ||= Issue.by_tracker(@project) |
|
98 | 91 | end |
@@ -190,12 +190,6 class RepositoriesController < ApplicationController | |||
|
190 | 190 | end |
|
191 | 191 | |
|
192 | 192 | private |
|
193 | def find_project | |
|
194 | @project = Project.find(params[:id]) | |
|
195 | rescue ActiveRecord::RecordNotFound | |
|
196 | render_404 | |
|
197 | end | |
|
198 | ||
|
199 | 193 | def find_repository |
|
200 | 194 | @project = Project.find(params[:id]) |
|
201 | 195 | @repository = @project.repository |
@@ -34,11 +34,4 class WikisController < ApplicationController | |||
|
34 | 34 | redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'wiki' |
|
35 | 35 | end |
|
36 | 36 | end |
|
37 | ||
|
38 | private | |
|
39 | def find_project | |
|
40 | @project = Project.find(params[:id]) | |
|
41 | rescue ActiveRecord::RecordNotFound | |
|
42 | render_404 | |
|
43 | end | |
|
44 | 37 | end |
General Comments 0
You need to be logged in to leave comments.
Login now