Reputation: 707
I have to execute TFS on-premise REST APIs to get some data. Now I want to list out the minimum permission requirement to execute them.
The below are the REST APIs I am looking for:
GET https://{instance}/_apis/projectcollections/{collection}?api-version={version}
GET https://{instance}/DefaultCollection/_apis/projects?api-version={version}[&stateFilter{string}&$top={integer}&skip={integer}]
GET https://{instance}/DefaultCollection/_apis/projects/{project}?api-version={version}[&includeCapabilities={boolean}]
GET https://{instance}/DefaultCollection/_apis/projects/{project}/teams?api-version={version}[&$top={integer}&$skip={integer}]
GET https://{instance}/DefaultCollection/_apis/projects/{project}/teams/{team} ?api-version={version}
GET https://{instance}/DefaultCollection/_apis/projects/{project}/teams/{team}/members ?api-version={version}[&$top={integer}&$skip={integer}]
GET https://{instance}/DefaultCollection/_apis/tfvc/branches?api-version={version}[&includeChildren={bool}&includeDeleted={bool}]
GET https://{instance}/DefaultCollection/_apis/tfvc/branches/{path}?api-version={version}[&includeChildren={bool}&includeParent={bool}&includeDeleted={bool}]
GET https://{instance}/DefaultCollection/_apis/tfvc/changesets?api-version={version}
GET https://{instance}/DefaultCollection/_apis/tfvc/changesets/{id}?api-version={version}[&includeDetails={Boolean}&includeWorkItems={Boolean}&includeSourceRenames={Boolean}&maxChangeCount={int}&maxCommentLength={int}]
GET https://{instance}/DefaultCollection/_apis/tfvc/changesets/{id}/changes?api-version={version}[&$skip={int}&$top={int}]
GET https://{instance}/DefaultCollection/_apis/tfvc/shelvesets?api-version={version}[&owner={string}&maxContentLength={int}&$top={int}&$skip={int}]
GET https://{instance}/DefaultCollection/_apis/tfvc/shelvesets/{shelveset};{owner} ?api-version={version}
GET https://{instance}/DefaultCollection/_apis/tfvc/shelvesets/{shelveset};{owner}/changes ?api-version={version}
GET https://{instance}/DefaultCollection/_apis/tfvc/shelvesets/{shelveset};{owner}/workitems?api-version={version}
GET https://{instance}/DefaultCollection/_apis/tfvc/labels ?api-version={version}[&name={srtring}&owner={string}&itemLabelFilter={string}&$top={int}&$skip={int}]
GET https://{instance}/DefaultCollection/_apis/tfvc/labels/{labelId} ?api-version={version}[&maxItemCount={int}]
GET https://{instance}/DefaultCollection/_apis/tfvc/labels/{labelId}/items ?api-version={version}[&$top={int}&$skip={int}]
GET https://{instance}/DefaultCollection/_apis/tfvc/items/{path} ?api-version={version}&[scopePath={scopePath}]
Upvotes: 2
Views: 533
Reputation: 4202
To use the 1st~3rd REST API, you need to be colleciton administrator of that collection.
To use the 4th~6th REST API, you need to be a TFS project administrator
To use those from 7th to the last, you need to have the permission "View project-level information" set to allow. You could be a contributor. And make sure the use to have the permission to view codes under team project.
Upvotes: 3