user2237585
user2237585

Reputation: 21

How to deny contributions using TFSSecurity with Git

Using TFSSecurity I need to prevent contributions to certain Git branches. Previously we'd do this via the web interface to TFS and deny the contribute permission to the contributors group but now need to automate it.

I know I can turn make amendments to the master branch of repo using TFSSecurity but can't find an example of how to do it on another branch.

Can anyone assist?

Thanks

Upvotes: 1

Views: 177

Answers (1)

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51103

TFSsecurity command is using below format to set permission:

tfssecurity /a+ Namespace Token Action Identity (ALLOW | DENY) [/collection:CollectionURL] [/server:ServerURL]

There is a concept of namespace

Namespace

The namespace that contains the group to which you want to add permissions for a user or group. You can also use the tfssecurity /a command to view a list of namespaces at the server, collection, and project level.

Source Link: Change groups and permissions with TFSSecurity

Only a namespace for git repo called "Git Repositories", have not any namespace for specifically git branch.

For setting git branch permissions, you may have to do this through web portal for now. Also take a look at this related question: TFSSecurity to change git branch permissions

Upvotes: 1

Related Questions