summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-03-02 16:47:10 -0300
committerToon Claes <toon@gitlab.com>2017-03-03 12:02:41 +0100
commit06e96907eef49c3be1b3608e77420e42d554943a (patch)
tree36e8c1d69e1822d04e46b0195c4ca4b83182b656 /lib
parenta9a581567c6d56186feade11ad867a66ab872ca6 (diff)
downloadgitlab-ce-06e96907eef49c3be1b3608e77420e42d554943a.tar.gz
Add filter param for authorized projects for current_user for V4
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 4600abc7dc7..cf57cb1b825 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -252,6 +252,10 @@ module API
# project helpers
def filter_projects(projects)
+ if params[:authorized]
+ projects = projects.merge(current_user.authorized_projects)
+ end
+
if params[:owned]
projects = projects.merge(current_user.owned_projects)
end