summaryrefslogtreecommitdiff
path: root/app/controllers/users_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-30 18:22:59 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-30 18:22:59 +0300
commit72b295259ed8565e166a7f2a466ca33d183f6108 (patch)
tree212287c4c19595bf1e41453c796ec6310a6aad7f /app/controllers/users_controller.rb
parentd54d3324b1ae46a60712dbb974214e41fca5b93b (diff)
downloadgitlab-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.rb4
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