Fixed confidentiality issue on account/show.

Only public projects or private projects that the logged in user belongs to are displayed.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@567 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-06-23 14:06:21 +00:00
parent 1c44600c62
commit 1a2aee84b2
2 changed files with 10 additions and 5 deletions
+5
View File
@@ -28,6 +28,11 @@ class AccountController < ApplicationController
def show
@user = User.find(params[:id])
@custom_values = @user.custom_values.find(:all, :include => :custom_field)
# show only public projects and private projects that the logged in user is also a member of
@memberships = @user.memberships.select do |membership|
membership.project.is_public? || (logged_in_user && logged_in_user.role_for_project(membership.project))
end
rescue ActiveRecord::RecordNotFound
render_404
end