diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 9b54a90ec..ecf37ed53 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -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 diff --git a/app/views/account/show.rhtml b/app/views/account/show.rhtml index 19fedb3b6..cadd807f0 100644 --- a/app/views/account/show.rhtml +++ b/app/views/account/show.rhtml @@ -13,12 +13,12 @@

<%=l(:label_project_plural)%>

-

-<% for membership in @user.memberships %> - <%= membership.project.name %> (<%= membership.role.name %>, <%= format_date(membership.created_on) %>) -
+

<%=l(:label_activity)%>