开发者

TFS Work Item type - Access to field based on rights

开发者 https://www.devze.com 2023-04-05 14:31 出处:网络
I have work item type template where i want to assign right to change drop down list to default value as \"Requested\" for new item and every one can see and read it.

I have work item type template where i want to assign right to change drop down list to default value as "Requested" for new item and every one can see and read it. If user is in group "[TEAM FOUNDATION]\Approvers" or "[TEAM FOUNDATION]\Developers" they are able to change this item.

I have a problem if user is not in either of the groups it will fail and blank display disabled field. How do i define these permissions?

My definition of field is below.

<FIELD name="Approval" refname="Approval" type="String" reportable="dimension">
    <REQUIRED />
    <DEFAULT from="value" value="Requested" />
    <ALLOWEDVALUES>
      <LISTITEM value="Approved" />
      <LISTITEM value="Requested" />
      <LISTITEM value="Rejected" />
    </ALLOWEDVALUES>        
    <DEFAULT from="value" value="Requested" />
    <READONLY not="[TEAM FOUNDATION]\Approvers" />
    <READONLY not="[TEAM FOUNDATION]\Developers" />
    <HELPTEXT>Shows whether the 开发者_StackOverflowtask has been approved by management.</HELPTEXT>
  </FIELD>


This seems like a heavy one.What is your exact intend? Maybe using a WHEN block or splitting the restrictions into basic ones (at the field definition) and special ones at state or transition level will solve your problem?

<FIELD name="Approval" refname="Approval" type="String" reportable="dimension">
    <REQUIRED />
    <DEFAULT from="value" value="Requested" />
    <WHENNOT field="System.State" value="New">
      <READONLY not="[TEAM FOUNDATION]\Developers"/>
      <READONLY not="[TEAM FOUNDATION]\Approvers"/>
    </WHENNOT>
    <HELPTEXT>Shows whether the task has been approved by management.</HELPTEXT>
</FIELD>

or

<FIELD name="Approval" refname="Approval" type="String" reportable="dimension">
    <REQUIRED />
    <ALLOWEDVALUES>
      <LISTITEM value="Approved" />
      <LISTITEM value="Requested" />
      <LISTITEM value="Rejected" />
    </ALLOWEDVALUES>        
    <DEFAULT from="value" value="Requested" />
    <HELPTEXT>Shows whether the task has been approved by management.</HELPTEXT>
</FIELD>

<TRANSITION from="" to="New">
    <FIELDS>
        <FIELD refname="Approval">
            <READONLY not="[TEAM FOUNDATION]\Developers"/>
            <READONLY not="[TEAM FOUNDATION]\Approvers"/>
        </FIELD>
</TRANSITION>

By the way: You should refName your fields with a whole "Namespace", e.g. "My.Company.TfsFields.Common.Approval" or "My.Company.TfsFields.Bugs.IsRegression"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号