TFS 工作项:“分配给”中的用户field 是唯一可以更新此工作项的用户
我正在使用 Visual Studio 2010 和 Visual Studio 2010 上的流程编辑器创建自己的流程模板。 TFS 2010。
我想修改工作项类型定义以实现以下任一目的:
- 工作项只能由分配给它的用户(“System.AssignedTo”字段中的用户)更新。其他用户不应修改该工作项。
- 工作项状态字段“System.State”只能由该工作项分配的用户修改。
提前致谢
I am creating my own process template using process editor on Visual Studio 2010 & TFS 2010.
I want to modify work item type definition to achieve any of the following:
- The work item can only be updated by the user assigned to it (the user in the "System.AssignedTo" field). Other users should not modify the work item.
- Work item state field "System.State" can only be modified by this work item assigned user.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来你的两个问题是同一个问题:
如何将更改工作项或工作项中的特定字段的选项限制为除工作项“分配给”之外的所有用户?
我有一个解决方案给你,但它在 MTM 中不起作用,只能在 Visual Studio 中起作用。
1) 您构建一个简单的自定义工作项控件(在此处查找示例 - http://witcustomcontrols.codeplex.com/) 没有用户界面。
2) 在控件中,您重写 FlushToDatasource 方法,并在保存工作项的条件中编写代码,例如 - 当前用户是否与“分配给”用户相同?
3)如果您的条件未设置,则抛出异常并进行适当的按摩。 “您没有保存\更改工作项的权限”
要获取当前用户:
_workItem.Project.Store.TeamProjectCollection.AuthorizedIdentity.DisplayName;
要分配给用户:
_workItem.Fields.["System.AssignedTo"].Value.ToString();
祝你好运! :)
It seems that both your questions are the same question:
How to restrict the option of changing a work item, or specific fields in a work item, to all users but the one to whom the work item is "Assigned To"??
I have a solution for you, but it will not work in MTM, only in visual studio.
1) You build a simple custom work item control (find samples here - http://witcustomcontrols.codeplex.com/) with no UI.
2) In the control you override the FlushToDatasource method, and code in your condition for saving the work Item, such as - is the current user is the same as the "Assigned To" user?
3) If you condition is not set throw an exception with the proper massage. "You don't Permission to save\change the work item"
To get the current user:
_workItem.Project.Store.TeamProjectCollection.AuthorizedIdentity.DisplayName;
To get the assigned to user:
_workItem.Fields.["System.AssignedTo"].Value.ToString();
Good luck! :)
在接下来的几天里,我将尽力在我的博客中发布创建 Web 控件的正确且完整的过程。
检查后我一定会将其包含在帖子中。
不管怎样,如果我必须猜测,我会说以同样的方式或通过简单的“return;”是可能的。或者使用 Response.clear(); + Response.write("alert('无权限')"); + Response.Flush();
不确定语法,还没有检查。
希望我能有所帮助,我会在几天内向您发送完整的帖子。 :)
祝你好运! :)
I will do my best to post in my blog in the next few days a proper and complete process of creating a web control.
I'll be sure to include this in the post after I check it.
Either way, if I'll have to guess I'll say that it'll be possible in the same way OR with a simple "return;" OR with a Response.clear(); + Response.write("alert('No permissions')"); + Response.Flush();
NOT SURE ABOUT THE SYNTEXT, HAVEN'T CHECK IT YET.
Hope I helped, I'll send you the full post in a few days. :)
Good luck! :)