summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-05-23 15:48:13 +0200
committerToon Claes <toon@gitlab.com>2017-05-30 22:45:59 +0200
commit07fc79e7c53a4fa7c4dd33835b905dfa8a609ff8 (patch)
treecc9fc22af268c599f8a0f5f157b73462ba70062a /lib/api/projects.rb
parent4fda13b68eb7da27be5e74cac6d3d537502b19f7 (diff)
downloadgitlab-ce-07fc79e7c53a4fa7c4dd33835b905dfa8a609ff8.tar.gz
Handle `membership` in ProjectFinder
The ProjectFinder supports the `non_public` parameter. This can be used to find only projects the user is member of.
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index ef09dfa0102..bb03480f1ee 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -68,7 +68,10 @@ module API
end
def present_projects(options = {})
- projects = ProjectsFinder.new(current_user: current_user).execute
+ finder_params = {}
+ finder_params[:non_public] = true if params[:membership].present?
+
+ projects = ProjectsFinder.new(current_user: current_user, params: finder_params).execute
projects = filter_projects(projects)
projects = projects.with_statistics if params[:statistics]
projects = projects.with_issues_enabled if params[:with_issues_enabled]