summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-03-03 12:00:34 +0100
committerToon Claes <toon@gitlab.com>2017-03-03 13:42:39 +0100
commit6357635686fafb2fc9af5090c1edabfe25649085 (patch)
tree978bb01a0486e2d323ec1a6096140c24794e6bae /lib
parent06e96907eef49c3be1b3608e77420e42d554943a (diff)
downloadgitlab-ce-6357635686fafb2fc9af5090c1edabfe25649085.tar.gz
Rename query parameter to `membership`28865-filter-by-authorized-projects-in-v4
The query parameter `membership` should be more self-explaining.
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers.rb2
-rw-r--r--lib/api/projects.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index cf57cb1b825..9c41146f1e3 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -252,7 +252,7 @@ module API
# project helpers
def filter_projects(projects)
- if params[:authorized]
+ if params[:membership]
projects = projects.merge(current_user.authorized_projects)
end
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index f302496c12b..63a4cdd5954 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -46,9 +46,10 @@ module API
optional :archived, type: Boolean, default: false, desc: 'Limit by archived status'
optional :visibility, type: String, values: Gitlab::VisibilityLevel.string_values,
desc: 'Limit by visibility'
- optional :search, type: String, desc: 'Return list of authorized projects matching the search criteria'
+ optional :search, type: String, desc: 'Return list of projects matching the search criteria'
optional :owned, type: Boolean, default: false, desc: 'Limit by owned by authenticated user'
optional :starred, type: Boolean, default: false, desc: 'Limit by starred status'
+ optional :membership, type: Boolean, default: false, desc: 'Limit by projects that the current user is a member of'
end
params :statistics_params do