def authorize_global(ctrl = params[:controller], action = params[:action], global = true)
authorize(ctrl, action, global)
end
+
+ # Find project of id params[:id]
+ def find_project
+ @project = Project.find(params[:id])
+ rescue ActiveRecord::RecordNotFound
+ render_404
+ end
# make sure that the user is a member of the project (or admin) if project is private
# used as a before_filter for actions that do not require any particular permission on the project
end
private
- def find_project
- @project = Project.find(params[:id])
- rescue ActiveRecord::RecordNotFound
- render_404
- end
-
def find_member
@member = Member.find(params[:id])
@project = @member.project
end
private
- # Find project of id params[:id]
- # if not found, redirect to project list
- # Used as a before_filter
- def find_project
- @project = Project.find(params[:id])
- rescue ActiveRecord::RecordNotFound
- render_404
- end
-
def find_optional_project
return true unless params[:id]
@project = Project.find(params[:id])
end
private
- # Find project of id params[:id]
- def find_project
- @project = Project.find(params[:id])
- rescue ActiveRecord::RecordNotFound
- render_404
- end
-
def issues_by_tracker
@issues_by_tracker ||= Issue.by_tracker(@project)
end
end
private
- def find_project
- @project = Project.find(params[:id])
- rescue ActiveRecord::RecordNotFound
- render_404
- end
-
def find_repository
@project = Project.find(params[:id])
@repository = @project.repository
redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'wiki'
end
end
-
-private
- def find_project
- @project = Project.find(params[:id])
- rescue ActiveRecord::RecordNotFound
- render_404
- end
end