Users who are given Write or Change access to a Project can modify all issues in the project. However, an Administrator can configure restrictions as part of a Workflow that will make an issue and/or its individual elements read-only. This can be applied to one or more specific statuses in a workflow or to all statuses in a workflow. Restrictions are applied by project and effect all members of the project unless specifically configured otherwise.
- How to Make Issues Read-only
- How to Make a Specific Element(s) of Issues Read-only
- How to Specify Restrictions
- Applying Restrictions to All Workflow Statuses
Prerequisites
- You must have "Change" access rights to the CMS project OR the Administrator role in the server.
How to Make Issues Read-only
To make all elements of an issue read-only, the Restriction field should be set to "*". In the below example, when an issue has a Status of "Closed", all of its elements will be read-only for all users in the project.
<Workflow initialStatus="New"> <Status name="New"> <NextStatuses> <NextStatus name="Closed"/> <NextStatus name="In Progress"/> </NextStatuses> </Status> <Status name="In Progress"> <NextStatuses> <NextStatus name="Closed"/> </NextStatuses> </Status> <Status name="Closed"> <NextStatuses> <NextStatus name="In Progress"/> </NextStatuses> <Restrictions> <Restriction field="*" test="false"/> </Restrictions> </Status> </Workflow>
How to Make a Specific Element(s) of Issues Read-only
To make specific elements of an issue read-only instead of all elements in a specific status, use one of the following field values.
- Name
- Type
- AssignedTo
- Status
- Description
- Iteration
- Attribute:ASID (provide the SID of the attribute)
- Attachments
- Relationship:ASID (provide the SID of the relationship)
- Notes
In the below example, the Attribute with SID "ABAN" cannot be edited if the issue has a Status of "Closed".
<Workflow initialStatus="New"> <Status name="New"> <NextStatuses> <NextStatus name="Closed"/> <NextStatus name="In Progress"/> </NextStatuses> </Status> <Status name="In Progress"> <NextStatuses> <NextStatus name="Closed"/> </NextStatuses> </Status> <Status name="Closed"> <NextStatuses> <NextStatus name="In Progress"/> </NextStatuses> <Restrictions> <Restriction field="Attribute:ABAN"/> </Restrictions> </Status> </Workflow>
Restricting edits to the following attribute types is not supported:
- External reference
- Computed
- Custom
- Identity
How to Specify Restrictions
To specify that a restriction only applies to a specific user or users, i.e., a specific user or users are restricted from editing a field element, enter a test using the Path Query Language to define the restriction. In the below example, if the logged-in user has the 'ABCD' role, they can make changes to the issue if issue has a Status of "Closed". Users without that role cannot.
<Workflow initialStatus="New"> <Status name="New"> <NextStatuses> <NextStatus name="Closed"/> <NextStatus name="In Progress"/> </NextStatuses> </Status> <Status name="In Progress"> <NextStatuses> <NextStatus name="Closed"/> </NextStatuses> </Status> <Status name="Closed"> <NextStatuses> <NextStatus name="In Progress"/> </NextStatuses> <Restrictions> <Restriction field="*" test="CurrentUser.HasRole('ABCD')"/> </Restrictions> </Status> </Workflow>
Applying Restrictions to All Workflow Statuses
In the above examples, restrictions were configured for issues having a Status of "Closed". However, it is possible to configure the restrictions to apply to ALL statuses. This is done using the <All> tag placed within <Workflow> and along side all of the <Status> tags. In the below example, the ABAN Attribute, Attachments, IR Relationships, and Notes will all be read-only if the logged-in user does not have the 'ABCD' role.
<Workflow initialStatus="New"> <Status name="New"> <NextStatuses> <NextStatus name="Closed"/> <NextStatus name="In Progress"/> </NextStatuses> </Status> <Status name="In Progress"> <NextStatuses> <NextStatus name="Closed"/> </NextStatuses> </Status> <Status name="Closed"> <NextStatuses> <NextStatus name="In Progress"/> </NextStatuses> </Status> <All> <Restrictions> <Restriction field="Attribute:ABAN" test="CurrentUser.HasRole('ABCD')"/> <Restriction field="Attachments" test="CurrentUser.HasRole('ABCD')"/> <Restriction field="Relationship:IR" test="CurrentUser.HasRole('ABCD')"/> <Restriction field="Notes" test="CurrentUser.HasRole('ABCD')"/> </Restrictions> </All> </Workflow>
Note: Currently, it is not possible to restrict the removal of an issue from a project. |