diff options
author | Andriy Dyadyura <adyadyura@Andriys-MacBook-Pro.fritz.box> | 2015-12-23 18:53:48 +0300 |
---|---|---|
committer | Andriy Dyadyura <adyadyura@Andriys-MacBook-Pro.fritz.box> | 2015-12-23 18:53:48 +0300 |
commit | 556137661f1d896d7366b9e0c5cd5c4291cb023d (patch) | |
tree | ea2f6872af20f89baf302a57794cdee885469775 | |
parent | cee776c1430e16889001b3a12758a801f956e244 (diff) | |
parent | f2b00e7ce1ee1096d8ec4df1eb0ca614b786804d (diff) |
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into new-tabs-builds
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/note_form.scss | 1 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/notes.scss | 2 | ||||
-rw-r--r-- | doc/api/projects.md | 10 | ||||
-rw-r--r-- | lib/api/projects.rb | 6 | ||||
-rw-r--r-- | spec/requests/api/projects_spec.rb | 13 |
6 files changed, 28 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG index 851a8ed0145..8099951b095 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.4.0 (unreleased) - Implement new UI for group page + - Add project permissions to all project API endpoints (Stan Hu) v 8.3.0 - Add CAS support (tduehr) diff --git a/app/assets/stylesheets/pages/note_form.scss b/app/assets/stylesheets/pages/note_form.scss index 18cfcc05e7b..d86259f93fb 100644 --- a/app/assets/stylesheets/pages/note_form.scss +++ b/app/assets/stylesheets/pages/note_form.scss @@ -79,7 +79,6 @@ padding: $gl-padding; margin-left: -$gl-padding; margin-right: -$gl-padding; - border-top: 1px solid $border-color; margin-bottom: -$gl-padding; } diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss index 4dff87abaa4..72b0ed29a69 100644 --- a/app/assets/stylesheets/pages/notes.scss +++ b/app/assets/stylesheets/pages/notes.scss @@ -128,7 +128,7 @@ ul.notes { } &:last-child { - border-bottom: none; + border-bottom: 1px solid $border-color; } } } diff --git a/doc/api/projects.md b/doc/api/projects.md index 658e65c6f01..0ca81ffd49e 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -118,6 +118,16 @@ Parameters: "path": "brightbox", "updated_at": "2013-09-30T13:46:02Z" }, + "permissions": { + "project_access": { + "access_level": 10, + "notification_level": 3 + }, + "group_access": { + "access_level": 50, + "notification_level": 3 + } + }, "archived": false, "avatar_url": null } diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 5e75cd35c56..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,7 +36,7 @@ module API @projects = current_user.owned_projects @projects = filter_projects(@projects) @projects = paginate @projects - present @projects, with: Entities::Project + present @projects, with: Entities::ProjectWithAccess, user: current_user end # Gets starred project for the authenticated user @@ -59,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 diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 01d2ec79482..7f0f9454b10 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -131,6 +131,7 @@ describe API::API, api: true do expect(json_response).to satisfy do |response| response.one? do |entry| + entry.has_key?('permissions') && entry['name'] == project.name && entry['owner']['username'] == user.username end @@ -382,6 +383,18 @@ describe API::API, api: true do end describe 'permissions' do + context 'all projects' do + it 'Contains permission information' do + project.team << [user, :master] + get api("/projects", user) + + expect(response.status).to eq(200) + expect(json_response.first['permissions']['project_access']['access_level']). + to eq(Gitlab::Access::MASTER) + expect(json_response.first['permissions']['group_access']).to be_nil + end + end + context 'personal project' do it 'Sets project access and returns 200' do project.team << [user, :master] |