| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 728f2dd commit cebbbf6
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,6 +35,15 @@ Create a protected branch:: | |||
| 35 | 35 | 'push_access_level': gitlab.MAINTAINER_ACCESS | |
| 36 | 36 | }) | |
| 37 | 37 | ||
| 38 | + Create a protected branch with more granular access control:: | ||
| 39 | + | ||
| 40 | + p_branch = project.protectedbranches.create({ | ||
| 41 | + 'name': '*-stable', | ||
| 42 | + 'allowed_to_push': [{"user_id": 99}, {"user_id": 98}], | ||
| 43 | + 'allowed_to_merge': [{"group_id": 653}], | ||
| 44 | + 'allowed_to_unprotect': [{"access_level": gitlab.MAINTAINER_ACCESS}] | ||
| 45 | + }) | ||
| 46 | + | ||
| 38 | 47 | Delete a protected branch:: | |
| 39 | 48 | ||
| 40 | 49 | project.protectedbranches.delete('*-stable') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3117,7 +3117,10 @@ class ProjectProtectedBranchManager(NoUpdateMixin, RESTManager): | |||
| 3117 | 3117 | _path = '/projects/%(project_id)s/protected_branches' | |
| 3118 | 3118 | _obj_cls = ProjectProtectedBranch | |
| 3119 | 3119 | _from_parent_attrs = {'project_id': 'id'} | |
| 3120 | - _create_attrs = (('name', ), ('push_access_level', 'merge_access_level')) | ||
| 3120 | + _create_attrs = (('name', ), | ||
| 3121 | + ('push_access_level', 'merge_access_level', | ||
| 3122 | + 'unprotect_access_level', 'allowed_to_push', | ||
| 3123 | + 'allowed_to_merge', 'allowed_to_unprotect')) | ||
| 3121 | 3124 | ||
| 3122 | 3125 | ||
| 3123 | 3126 | class ProjectRunner(ObjectDeleteMixin, RESTObject): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments