summaryrefslogtreecommitdiff
path: root/docs/gl_objects/protected_branches.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/gl_objects/protected_branches.rst')
-rw-r--r--docs/gl_objects/protected_branches.rst11
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/gl_objects/protected_branches.rst b/docs/gl_objects/protected_branches.rst
index bd2b22b..3498aa5 100644
--- a/docs/gl_objects/protected_branches.rst
+++ b/docs/gl_objects/protected_branches.rst
@@ -32,7 +32,16 @@ Create a protected branch::
p_branch = project.protectedbranches.create({
'name': '*-stable',
'merge_access_level': gitlab.DEVELOPER_ACCESS,
- 'push_access_level': gitlab.MASTER_ACCESS
+ 'push_access_level': gitlab.MAINTAINER_ACCESS
+ })
+
+Create a protected branch with more granular access control::
+
+ p_branch = project.protectedbranches.create({
+ 'name': '*-stable',
+ 'allowed_to_push': [{"user_id": 99}, {"user_id": 98}],
+ 'allowed_to_merge': [{"group_id": 653}],
+ 'allowed_to_unprotect': [{"access_level": gitlab.MAINTAINER_ACCESS}]
})
Delete a protected branch::