mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
Fixes #820: invalid project id causes a NoMethodError in SearchController (Angel Dobbs-Sciortino).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1237 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -102,13 +102,17 @@ class ApplicationController < ActionController::Base
|
||||
# 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
|
||||
def check_project_privacy
|
||||
unless @project.active?
|
||||
if @project && @project.active?
|
||||
if @project.is_public? || User.current.member_of?(@project) || User.current.admin?
|
||||
true
|
||||
else
|
||||
User.current.logged? ? render_403 : require_login
|
||||
end
|
||||
else
|
||||
@project = nil
|
||||
render_404
|
||||
return false
|
||||
false
|
||||
end
|
||||
return true if @project.is_public? || User.current.member_of?(@project) || User.current.admin?
|
||||
User.current.logged? ? render_403 : require_login
|
||||
end
|
||||
|
||||
# store current uri in session.
|
||||
|
||||
Reference in New Issue
Block a user