summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-16 11:40:33 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-16 11:40:33 +0200
commit974281d140a37d8c480bcf871b9498c50d42769b (patch)
tree1eb7743ac6113a59d68c317791c9e9d8ae1c0e0b /app
parenta77dfc464b033038537da1a4710b39df37a2cc06 (diff)
downloadgitlab-ce-974281d140a37d8c480bcf871b9498c50d42769b.tar.gz
FilteringService works with scope :all event if current user is not defined
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r--app/services/filtering_service.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/services/filtering_service.rb b/app/services/filtering_service.rb
index f8adeb20ff7..b339065890b 100644
--- a/app/services/filtering_service.rb
+++ b/app/services/filtering_service.rb
@@ -44,7 +44,11 @@ class FilteringService
when 'created-by-me', 'authored' then
current_user.send(table_name)
when 'all' then
- klass.of_projects(current_user.authorized_projects.pluck(:id))
+ if current_user
+ klass.of_projects(current_user.authorized_projects.pluck(:id))
+ else
+ klass.of_projects(Project.public_only)
+ end
when 'assigned-to-me' then
current_user.send("assigned_#{table_name}")
else