Tiago Pascoal's WebLog

Hello Good Evening and welcome to nothing much.

Team Foundation Server: Restricting Work Item creation based on a role

 

A while ago, i was asked a simple question. How can we restrict work item creation based on a user role. For example on MSF CMMI template, only testers can create Scenario Work Items.

To my knowledge there was no straightforward way to do it, but i though of a way to do it.

  1. Create (or use an existing one) mandatory field, and then place a restriction that the field is readonly for certain roles.
  2. On the workflow definition, create a restriction saying that only permitted roles are allowed to transition to a given state. In this case the given state would be the initial state (Active normally).

Technique number one, is not possible. since it is contradiction to have a field mandatory and read only (even if conditional)

Technique number two, can be achieved with the following XML, (placed on the TRANSICTIONS element, inside the the WORKFLOW element of the work item, to which you want to place the restrition)

<TRANSITION from="" to="Active" not="[global]\Team Foundation Administrators">

If you are thinking that this solution, is nothing more than a hack you are absolutely true. It is an hack, but it works. Although in a very inelegant way. If you implement this solution and try to create a "restricted" work item type you get the following error:

TF26212: Team Foundation Server could not save your changes. There may be problems with the work item type definition. Try again or contact your Team Foundation Server administrator.

No elegance at all indeed.

Does anyone know of a cleaner way to do it?

[Cross posted on http://www.agilior.pt/blogs/tiago.pascoal/archive/...]

Posted: Dec 31 2006, 06:32 PM by tspascoal | with 11 comment(s)
Filed under:

Comments

Yosi Taguri said:

You could write a Visual Studio Addin to catch the save event of a workitem and then throw an expception if you don't want to save it. the problem with this scenario is that: 1. You have to throw an exception to say "I don't want to save". 2. you need to install it on the clients.

# December 31, 2006 5:00 PM

tspascoal said:

Apart from the hassle of the (already mentioned) to install the plugin on the client, it seems too much trouble for such a simple requirement.

In a controlled environment i would rather use the "TF26212: ..." ugly message and educate the users about it's meaning. :-)

In a perfect world, yeah the plugin would be a lot cleaner. :-) Althoug much less centralized then template/work item definition.

# January 2, 2007 5:59 AM

Team Foundation Server: Restricting Work Item creation based on a role said:

Pingback from  Team Foundation Server: Restricting Work Item creation based on a role

# November 27, 2007 4:25 AM

patrick said:

Nice post...your writing quality is really impressive.

# December 21, 2009 2:12 AM

Unique CoFFee Mugs said:

Have you ever regarded as adding extra movies for your blog site posts to maintain the readers a lot more entertained? I mean I just study as a result of the entire article of yours and it was very good but because I'm extra of a visual learner,I observed that to become more helpful. Just my my concept, Good luck.

--------------------------------------------

my website is  

http://happykidskaraoke.info

Also welcome you!

# November 22, 2010 10:37 PM

bloody deck said:

A mutual pal stated I must come take a have a look at your internet site. Glad I clicked around the hyperlink! I like the way you genuinely concentrate and get towards the bottom line but can  you operate by way of that last part again? Just a little?

--------------------------------------------

my website is <a href="zeroskateboards.org/.../skateboard-art.html">zero skateboards logo</a> .Also welcome you!

# December 3, 2010 2:01 PM

Violin Lessons said:

"Congratulations on having considered one of probably the most sophisticated blogs Ive arrive across in some time!  Its just amazing how significantly you'll be able to acquire away from  a thing simply simply because of how visually gorgeous it's.  Youve put together a great blog site area --great graphics, movies, layout.  This really is undoubtedly a must-see  blog site!"

--------------------------------------------

my website is  

http://6stringbass.net

Also welcome you!

# December 5, 2010 3:32 PM

ipad app prices said:

Nothing for nothing.

-----------------------------------

# December 18, 2010 3:21 PM

ipad app said:

-----------------------------------------------------------

"Hey - good blog. Just checking out some blogs, seems a fairly nice platform you are using. I'm currently employing Wordpress for a couple of my blogs but I'm not happy with it so a good deal. I am searching to change one of them over to a system an identical to yours (BlogEngine) as being a trial run. Anything in certain you'd recommend about it?"

# January 3, 2011 1:13 AM

dynex tv reviews said:

"How-do-you-do, just needed you to learn We have extra your site to my Yahoo bookmarks because of your extraordinary blog site layout. But severely, I think  your site has 1 of the freshest theme I have arrived across. It seriously assists make reading through your blog site a great deal simpler."

--------------------------------------------------------------------  

I have a <a href="ericsreviews.com/">nikon camera reviews</a> Website,i love him.Mania !You are welcome to look!

# January 16, 2011 11:20 PM

Leola Mcauly said:

The following absolutely a great web web page you've visiting this web site. The matter is quite useful in addition to direct clear. Ecstatic to discover to read yet another recommendation of your weblog next time.

# July 4, 2011 9:30 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)