summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard_controller.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-05-10 18:03:55 +0100
committerSean McGivern <sean@gitlab.com>2016-05-10 18:13:52 +0100
commit97424ea544d0954e582a356586270e983d3bbb7a (patch)
tree9d56780368e9823002f0d15ddc29e8db190090bf /app/controllers/dashboard_controller.rb
parent98d8e3fe9ff4d120469378490c41381ae751597e (diff)
downloadgitlab-ce-97424ea544d0954e582a356586270e983d3bbb7a.tar.gz
Restrict starred projects to viewable ones
`User#starred_projects` doesn't perform any visibility checks. This has a couple of problems: 1. It assumes a user can always view all of their starred projects in perpetuity (project not changed to private, access revoked, etc.). 2. It assumes that we'll only ever allow a user to star a project they can view. This is currently the case, but bugs happen. Add `User#viewable_starred_projects` to filter the starred projects by those the user either has explicit access to, or are public or internal. Then use that in all places where we list the user's starred projects.
Diffstat (limited to 'app/controllers/dashboard_controller.rb')
-rw-r--r--app/controllers/dashboard_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index 1dce4a21729..4dda4e51f6a 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -25,7 +25,7 @@ class DashboardController < Dashboard::ApplicationController
def load_events
projects =
if params[:filter] == "starred"
- current_user.starred_projects
+ current_user.viewable_starred_projects
else
current_user.authorized_projects
end