summaryrefslogtreecommitdiff
path: root/docs/gl_objects
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvainpocentek@gmail.com>2018-12-08 08:57:12 +0100
committerGitHub <noreply@github.com>2018-12-08 08:57:12 +0100
commit59e3e457f01810666d90381c25f52addecb606e2 (patch)
treef80e780e1bb87f0c2f5ba444d728e985cd2868f8 /docs/gl_objects
parent728f2dd1677522a4fcca76769ed127146c034c29 (diff)
parentcebbbf67f2529bd9380276ac28abe726d3a57a81 (diff)
downloadgitlab-59e3e457f01810666d90381c25f52addecb606e2.tar.gz
Merge pull request #656 from esabouraud/feature-protectedbranchesoptions
Issue 653 Add access control options to protected branch creation
Diffstat (limited to 'docs/gl_objects')
-rw-r--r--docs/gl_objects/protected_branches.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/gl_objects/protected_branches.rst b/docs/gl_objects/protected_branches.rst
index f0479e0..3498aa5 100644
--- a/docs/gl_objects/protected_branches.rst
+++ b/docs/gl_objects/protected_branches.rst
@@ -35,6 +35,15 @@ Create a protected branch::
'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::
project.protectedbranches.delete('*-stable')