【发布时间】:2012-06-19 04:25:57
【问题描述】:
我想在 DropDown 中列出 TFS 用户组,并且根据用户组的选择,我需要使用 TFS API 填充该特定组中的用户。
【问题讨论】:
标签: tfs
我想在 DropDown 中列出 TFS 用户组,并且根据用户组的选择,我需要使用 TFS API 填充该特定组中的用户。
【问题讨论】:
标签: tfs
最后一个例子可能是最相关的。
IGroupSecurityService gss = (IGroupSecurityService)server.GetService(typeof(IGroupSecurityService));
Identity[] UserId = gss.ReadIdentities(SearchFactor.Sid, SIDS.Members, QueryMembership.None);
【讨论】:
// Connect to the team project collection.
TfsConfigurationServer tfsServer = m_tfsServer;
Guid collectionGuid = m_collectionGuid;
TfsTeamProjectCollection tpc = tfsServer.GetTeamProjectCollection(collectionGuid);
// Get the group security service.
var gss = tpc.GetService<IGroupSecurityService2>();
// Retrieve each user's SID.
Identity sids = gss.ReadIdentity(SearchFactor.AccountName, "[My Team Project]\\Contributors", QueryMembership.Expanded);
// Resolve to named identities.
Identity[] users = gss.ReadIdentities(SearchFactor.Sid, sids.Members, QueryMembership.None);
【讨论】: