summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
authorMike Wyatt <wyatt.mike@gmail.com>2015-12-31 18:45:55 -0400
committerMike Wyatt <wyatt.mike@gmail.com>2015-12-31 18:45:55 -0400
commitcf4ccdda2728b6cc2879006898481d2ee786813c (patch)
tree6e20ab08ff8e329ca8725d653e4b1cb165845626 /lib/api/projects.rb
parent571df5f44bfec89b21bdce0f91f9acfdda6d7660 (diff)
parentd33cc4e53070e6afb576911aa4d76dc80eba78b7 (diff)
downloadgitlab-ce-cf4ccdda2728b6cc2879006898481d2ee786813c.tar.gz
Merge remote-tracking branch 'upstream/master' into better-asana-refs
* upstream/master: (307 commits) Update CHANGELOG spinach fix Updated allocations Gem to version 1.0.3 Removed various default metrics tags Update CHANGELOG Fix "I see current user as the first user" step Swap Author and Assignee Selectors on issuable index view Update CHANGELOG Make sure that is no pending migrations in Gitlab::CurrentSettings Added additional config environmental variables to help Debian packaging We don't use whenever anymore. Lets remove the schedule file Fix project transfer e-mail sending incorrect paths in e-mail notification Update CHANGELOG Use Gitlab::CurrentSettings for InfluxDB Write to InfluxDB directly via UDP Strip newlines from obfuscated SQL Add hotfix that allows to access build artifacts created before 8.3 note votes methids implementation When reCAPTCHA is disabled, allow registrations to go through without a code Downcased user or email search for avatar_icon. ...
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index bdf4b77596e..a9e0960872a 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -25,7 +25,7 @@ module API
@projects = current_user.authorized_projects
@projects = filter_projects(@projects)
@projects = paginate @projects
- present @projects, with: Entities::Project
+ present @projects, with: Entities::ProjectWithAccess, user: current_user
end
# Get an owned projects list for authenticated user
@@ -36,6 +36,17 @@ module API
@projects = current_user.owned_projects
@projects = filter_projects(@projects)
@projects = paginate @projects
+ present @projects, with: Entities::ProjectWithAccess, user: current_user
+ end
+
+ # Gets starred project for the authenticated user
+ #
+ # Example Request:
+ # GET /projects/starred
+ get '/starred' do
+ @projects = current_user.starred_projects
+ @projects = filter_projects(@projects)
+ @projects = paginate @projects
present @projects, with: Entities::Project
end
@@ -48,7 +59,7 @@ module API
@projects = Project.all
@projects = filter_projects(@projects)
@projects = paginate @projects
- present @projects, with: Entities::Project
+ present @projects, with: Entities::ProjectWithAccess, user: current_user
end
# Get a single project