summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2016-08-23 15:23:56 -0400
committerSean McGivern <sean@gitlab.com>2016-10-04 17:23:18 +0100
commite956a24dfd45baaafe93a520df61015bba40a4da (patch)
tree453bc7185a0b2f5587207638bc2f6e39143fdda1 /lib/api
parentb6b5033516210fc431a70f729b5678539c039b3f (diff)
downloadgitlab-ce-e956a24dfd45baaafe93a520df61015bba40a4da.tar.gz
api: add /projects/visible API endpoint
FIxes #19361, #3119.
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/projects.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 680055c95eb..52afbb4eef3 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -32,6 +32,21 @@ module API
end
end
+ # Get a list of visible projects for authenticated user
+ #
+ # Example Request:
+ # GET /projects/visible
+ get '/visible' do
+ @projects = ProjectsFinder.new.execute(current_user)
+ @projects = filter_projects(@projects)
+ @projects = paginate @projects
+ if params[:simple]
+ present @projects, with: Entities::BasicProjectDetails, user: current_user
+ else
+ present @projects, with: Entities::ProjectWithAccess, user: current_user
+ end
+ end
+
# Get an owned projects list for authenticated user
#
# Example Request: