I am creating my own process template using process editor on Visual Studio 2010 & TFS 2010.
开发者_StackOverflow中文版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
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! :)
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! :)
精彩评论