summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/projects.rb')
-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: