summaryrefslogtreecommitdiff
path: root/doc/api/protected_branches.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/protected_branches.md')
-rw-r--r--doc/api/protected_branches.md32
1 files changed, 16 insertions, 16 deletions
diff --git a/doc/api/protected_branches.md b/doc/api/protected_branches.md
index 9309306ba05..ffb4a70168b 100644
--- a/doc/api/protected_branches.md
+++ b/doc/api/protected_branches.md
@@ -185,6 +185,7 @@ Example response:
{
"access_level": 30,
"access_level_description": "Developers + Maintainers"
+ }
],
"unprotect_access_levels": [
{
@@ -217,6 +218,7 @@ Example response:
"user_id": null,
"group_id": null,
"access_level_description": "Developers + Maintainers"
+ }
],
"unprotect_access_levels": [
{
@@ -232,7 +234,7 @@ Example response:
### Example with user / group level access **(STARTER)**
Elements in the `allowed_to_push` / `allowed_to_merge` / `allowed_to_unprotect` array should take the
-form `{user_id: integer}`, `{group_id: integer}` or `{access_level: integer}`. Each user must have access to the project and each group must [have this project shared](../user/project/members/share_project_with_groups.md). These access levels allow [more granular control over protected branch access](../user/project/protected_branches.md#restricting-push-and-merge-access-to-certain-users-starter) and were [added to the API in ][ee-3516] in GitLab 10.3 EE.
+form `{user_id: integer}`, `{group_id: integer}` or `{access_level: integer}`. Each user must have access to the project and each group must [have this project shared](../user/project/members/share_project_with_groups.md). These access levels allow [more granular control over protected branch access](../user/project/protected_branches.md#restricting-push-and-merge-access-to-certain-users-starter) and were [added to the API in](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3516) in GitLab 10.3 EE.
```bash
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/5/protected_branches?name=*-stable&allowed_to_push%5B%5D%5Buser_id%5D=1'
@@ -242,29 +244,29 @@ Example response:
```json
{
- "name":"*-stable",
+ "name": "*-stable",
"push_access_levels": [
{
- "access_level":null,
- "user_id":1,
- "group_id":null,
- "access_level_description":"Administrator"
+ "access_level": null,
+ "user_id": 1,
+ "group_id": null,
+ "access_level_description": "Administrator"
}
],
"merge_access_levels": [
{
- "access_level":40,
- "user_id":null,
- "group_id":null,
- "access_level_description":"Maintainers"
+ "access_level": 40,
+ "user_id": null,
+ "group_id": null,
+ "access_level_description": "Maintainers"
}
],
"unprotect_access_levels": [
{
- "access_level":40,
- "user_id":null,
- "group_id":null,
- "access_level_description":"Maintainers"
+ "access_level": 40,
+ "user_id": null,
+ "group_id": null,
+ "access_level_description": "Maintainers"
}
]
}
@@ -286,5 +288,3 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" 'https://git
| --------- | ---- | -------- | ----------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `name` | string | yes | The name of the branch |
-
-[ee-3516]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3516 "ProtectedBranches API handles per user/group granularity"