Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2016-08-23 22:23:56 +0300
committerSean McGivern <sean@gitlab.com>2016-10-04 19:23:18 +0300
commite956a24dfd45baaafe93a520df61015bba40a4da (patch)
tree453bc7185a0b2f5587207638bc2f6e39143fdda1 /lib
parentb6b5033516210fc431a70f729b5678539c039b3f (diff)
api: add /projects/visible API endpoint
FIxes #19361, #3119.
Diffstat (limited to 'lib')
-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: