diff options
-rw-r--r-- | app/controllers/users_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d42c2db9e5f..c17c6f9694a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -11,7 +11,8 @@ class UsersController < ApplicationController end @groups = @user.groups.accessible_to(current_user) - @events = @user.recent_events.where(project_id: @projects.pluck(:id)).limit(20) + accessible_projects = @user.authorized_projects.accessible_to(current_user) + @events = @user.recent_events.where(project_id: accessible_projects.pluck(:id)).limit(20) @title = @user.name end |