Still pursuing my goal to automate permissions on VSTS, I'm trying to resolve identities to set permissions, or at least ignore permissions already set on some identities (declared at server level for instance).
Considering this code:
var uri = new Uri("https://<account>.visualstudio.com");
var pat = "YourPatHere";
var credential = new VssBasicCredential("", pat);
var connection = new VssConnection(uri, credential);
var identityClient = connection.GetClient<IdentityHttpClient>();
// scope at collection / default level
var collectionIdentities = identityClient.ReadIdentitiesAsync(new Guid("ae09d49d-b35f-445c-9b0d-8f1ec26d1efe")).Result;
// scope at server level
var serverIdentities = identityClient.ReadIdentitiesAsync(new Guid("7666fa45-57f1-47bc-8178-ccbdf1afef41")).Result;
On my test account, collectionIdentities contains 114 entries, serverIdentities, 118. So far so good.
Now if I want to resolve the following identity, declared at server level, and NOT referenced anywhere at the collection level:
Any call to ReadIdentitiesAsync or ReadIdentityAsync, passing the Guid or IdentityDescriptor returns null.
How can I resolve such identities other than querying at server level?
Hi,
Still pursuing my goal to automate permissions on VSTS, I'm trying to resolve identities to set permissions, or at least ignore permissions already set on some identities (declared at server level for instance).
Considering this code:
On my test account,
collectionIdentities
contains 114 entries,serverIdentities
, 118. So far so good.Now if I want to resolve the following identity, declared at server level, and NOT referenced anywhere at the collection level:
Any call to
ReadIdentitiesAsync
orReadIdentityAsync
, passing the Guid or IdentityDescriptor returns null. How can I resolve such identities other than querying at server level?