diff options
author | Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com> | 2010-08-10 23:07:44 +0000 |
---|---|---|
committer | Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com> | 2010-08-10 23:07:44 +0000 |
commit | e43f9fc21edc0a7b3451f64204c3399eab359529 (patch) | |
tree | 06c1fa6cd6bc240068a439e2dde62e0e5ef03ccb /app/controllers | |
parent | 0cfa757db0bed740e6641e245849a72a6f4632a8 (diff) | |
download | redmine-e43f9fc21edc0a7b3451f64204c3399eab359529.tar.gz redmine-e43f9fc21edc0a7b3451f64204c3399eab359529.zip |
Show projects depending on their visibility in user's profile. #6100
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3935 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/users_controller.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 023352d8a..0354d165d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -53,10 +53,8 @@ class UsersController < ApplicationController @user = User.find(params[:id]) @custom_values = @user.custom_values - # 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? || (User.current.member_of?(membership.project)) - end + # show projects based on current user visibility + @memberships = @user.memberships.all(:conditions => Project.visible_by(User.current)) events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 10) @events_by_day = events.group_by(&:event_date) |