diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-30 18:22:59 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-30 18:22:59 +0300 |
commit | 72b295259ed8565e166a7f2a466ca33d183f6108 (patch) | |
tree | 212287c4c19595bf1e41453c796ec6310a6aad7f /app/controllers/users_controller.rb | |
parent | d54d3324b1ae46a60712dbb974214e41fca5b93b (diff) | |
download | gitlab-ce-72b295259ed8565e166a7f2a466ca33d183f6108.tar.gz |
Show only personal projects on profile page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9461174b950..2d227ae2017 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -4,10 +4,12 @@ class UsersController < ApplicationController def show @user = User.find_by_username!(params[:username]) - @projects = @user.authorized_projects.accessible_to(current_user) + @projects = Project.personal(@user).accessible_to(current_user) + if !current_user && @projects.empty? return authenticate_user! end + @groups = @user.groups.accessible_to(current_user) @events = @user.recent_events.where(project_id: @projects.pluck(:id)).limit(20) @title = @user.name |