diff options
author | Markus Koller <markus-koller@gmx.ch> | 2016-11-29 20:21:39 +0100 |
---|---|---|
committer | Markus Koller <markus-koller@gmx.ch> | 2016-12-21 16:36:53 +0100 |
commit | d5c49779125f70c49ff8b160355d4999d27091ee (patch) | |
tree | c8f5f402156e6d842de7d34a08360a7a96dfbeeb /lib/api/projects.rb | |
parent | d05dd81b99b897bcf41bfa4055d1f42bb9669af9 (diff) | |
download | gitlab-ce-d5c49779125f70c49ff8b160355d4999d27091ee.tar.gz |
Consistently use current_user in API entities
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 2929d2157dc..f5609d878f8 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -75,7 +75,7 @@ module API projects = filter_projects(projects) entity = params[:simple] || !current_user ? Entities::BasicProjectDetails : Entities::ProjectWithAccess - present paginate(projects), with: entity, user: current_user + present paginate(projects), with: entity, current_user: current_user end desc 'Get a projects list for authenticated user' do @@ -94,7 +94,7 @@ module API projects = filter_projects(projects) entity = params[:simple] ? Entities::BasicProjectDetails : Entities::ProjectWithAccess - present paginate(projects), with: entity, user: current_user + present paginate(projects), with: entity, current_user: current_user end desc 'Get an owned projects list for authenticated user' do @@ -110,7 +110,7 @@ module API projects = current_user.owned_projects projects = filter_projects(projects) - present paginate(projects), with: Entities::ProjectWithAccess, user: current_user + present paginate(projects), with: Entities::ProjectWithAccess, current_user: current_user end desc 'Gets starred project for the authenticated user' do @@ -126,7 +126,7 @@ module API projects = current_user.viewable_starred_projects projects = filter_projects(projects) - present paginate(projects), with: Entities::Project, user: current_user + present paginate(projects), with: Entities::Project, current_user: current_user end desc 'Get all projects for admin user' do @@ -142,7 +142,7 @@ module API projects = Project.all projects = filter_projects(projects) - present paginate(projects), with: Entities::ProjectWithAccess, user: current_user + present paginate(projects), with: Entities::ProjectWithAccess, current_user: current_user end desc 'Search for projects the current user has access to' do @@ -221,7 +221,7 @@ module API end get ":id" do entity = current_user ? Entities::ProjectWithAccess : Entities::BasicProjectDetails - present user_project, with: entity, user: current_user, + present user_project, with: entity, current_user: current_user, user_can_admin_project: can?(current_user, :admin_project, user_project) end |