如何通过API向团队添加团队管理员 [英] How do I add a team administrator to a team by API
问题描述
我想以编程方式向团队管理员组添加身份
I want to programmatically add an identity to the team administrators group
运行代码的帐户是团队项目管理员。
The account that runs the code is team project administrator.
当我跑步时
TeamFoundationIdentity admin
TeamFoundationIdentity admin
string token = IdentityHelper.CreateSecurityToken (team.Identity);
string token = IdentityHelper.CreateSecurityToken(team.Identity);
securityNamespace.SetPermissions(token,admin.Descriptor,15,0,true);
securityNamespace.SetPermissions(token, admin.Descriptor, 15, 0, true);
I get
I get
{"拒绝访问:*******需要以下权限才能获得资源1cd761b1-4c54-42ec-9e82-7f8e72ccffea \\ e5258a4c -2b70-4133-b1df-94bb8fdc77a6执行此操作:删除身份信息"}
{"Access Denied: ******* needs the following permission(s) on the resource 1cd761b1-4c54-42ec-9e82-7f8e72ccffea\\e5258a4c-2b70-4133-b1df-94bb8fdc77a6 to perform this action: Delete identity information"}
如何通过api设置团队管理员?
How do I set the team admin by api?
问候,
R。
推荐答案
嗨Raf Van Hoof,
Hi Raf Van Hoof,
感谢您发布此处。
我已经测试了您在上面发布的代码并且它是正确的。我可以用它来添加团队管理员。
I have tested the code you post above and it is correct. I could use it to add a team administrator.
"******"错误消息中提到的帐户,是团队管理员还是团队项目管理员?您是否检查过。
The "******" account mentioned in the error message, is it a team administrator or team project administrator? Did you check that.
并尝试使用具有更高权限并进行测试的其他帐户。
And try to use other accounts which has higher permissions and have a test.
祝你好运
这篇关于如何通过API向团队添加团队管理员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!