Asterix
Asterix

Reputation: 433

Azure DevOps Permission to disable "Delete branch" option

I have created Coders User group with object level permission. Group is given Contributor permission for the project. When it comes to specific repository, I have applied object level permission- Like unable to delete a branch. When I verified it, the group is still able to see the Delete Branch option and they are able to delete it.

enter image description here

I have gone through Project Collection level permissions,Project permissions and Object level permissions. Even if we set Deny for Force Push, the group is able to use Delete branch option. So far, I have not seen an option to disable Delete branch option.

enter image description here

Has anyone set it before?

I am updating one more question here, regarding the New Folder in Pipeline. Is there a way to disable this as well for certain user group?

enter image description here

Upvotes: 11

Views: 11958

Answers (2)

Kevin Lu-MSFT
Kevin Lu-MSFT

Reputation: 35194

For question 1 related to repo:

Based on my test, disabling the Force Push Permission indeed can block users deleting the branch.

Users can see the Delete Branch option, but when the user click the delete option, it will show the error message:

For example:

enter image description here

If the users in the Coders Group still can delete the branch, you may need to check the permission for Single user.

enter image description here

For question 1 related to Pipeline:

I am afraid that there is no specific permission to prevent users from deleting the Pipeline folder.

For a workaround, you can create or add an exising Pipeline to the folder and Deny the Delete Build Pipeline Permission.

enter image description here

enter image description here

Then the users will have no access to delete the folder.

Upvotes: 1

ViBi
ViBi

Reputation: 637

Regarding your first question about "Delete branch"

One way to achieve that is by setting branch policies. Please see below

enter image description here

Upvotes: 14

Related Questions