FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Issue 653 Add access control options to protected branch creation by esabouraud · Pull Request #656 · python-gitlab/python-gitlab · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
9 changes: 9 additions & 0 deletions docs/gl_objects/protected_branches.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
5 changes: 4 additions & 1 deletion gitlab/v4/objects.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3117,7 +3117,10 @@ class ProjectProtectedBranchManager(NoUpdateMixin, RESTManager):
_path = '/projects/%(project_id)s/protected_branches'
_obj_cls = ProjectProtectedBranch
_from_parent_attrs = {'project_id': 'id'}
_create_attrs = (('name', ), ('push_access_level', 'merge_access_level'))
_create_attrs = (('name', ),
('push_access_level', 'merge_access_level',
'unprotect_access_level', 'allowed_to_push',
'allowed_to_merge', 'allowed_to_unprotect'))


class ProjectRunner(ObjectDeleteMixin, RESTObject):
Expand Down

Back | FazBrowse Home | New Git URL