Consider the following case: there are many users in a defect database. These users may come from different teams with an interest in a variety of different projects. To avoid confusion and unexpected operations within the system, the IBM® Rational® ClearQuest® administrator may need to isolate each user's records, so that only the record owner can view and modify his or her own record. If we classify these users by project, then, from a project-by-project point of view, the defect database appears to be unique for each user and each project.
This article illustrates how a ClearQuest administrator can isolate defect records by submitter. It provides step-by-step details on the procedure for customizing your database, and includes some hooks on how to control access rights to certain fields.
ClearQuest is a powerful tool for change management in software development. It is highly customizable, which enables users to control their different change management processes flexibly. ClearQuest also provides some predefined templates that will gradually introduce you to the nuances of the tool, beginning with some change management best practices.
For example, when you apply one of the standard templates to administer your change management processes, all team members can by default query all records in the database. This may cause your team confusion, or it may result in some unexpected or incorrect operations -- especially when you have several projects within one database. You may want to isolate these records by owner, project, role, or group. ClearQuest provides a mechanism called Security Context to help you achieve this goal.
In my example, I use TestStudio as the template, and explain how to customize this template to isolate defect records by submitter. The general steps are as follows:
- Define your isolation policy, and then create proper groups.
- Create a security context record type.
- Modify the record type for which you want to enable access control, and add a reference field.
- Compile some hooks, if needed.
- Apply the template to the user database and do some presets.
Note: this method is not limited to defect records; it can be applied to any record type to which you want to control access. The following scenario, however, will concentrate on defect management.
In this scenario, the testers in a project can only view and modify their own submitted records, but members of a test manager group can view all of the records. As a tester, each time you submit a defect, the security context field of the defect is automatically set to you as the owner. Only the ClearQuest administrator can view and modify the security context record type.
This example assumes you are familiar with the ClearQuest customization procedure -- I will walk through the steps, but not the specifics of what is happening behind the scenes. If you are new to this process, please review your ClearQuest documentation regarding the customization procedure.
- First of all, you need to define proper groups with the ClearQuest User Administration tool. I usually define a group for each tester, and then create a Test Manager group. In a sense, these groups represent specific roles in your project definition. For example, Figures 1-5 show details about my defined groups:
Figure 1. Setting up groups in ClearQuest
The groups xiaming, yangrong, zhanghan, yangrongwei, and gengxueping are tester groups for individual testers, respectively. The TestManager group is for the Test Manager role.
Figure 2. The definition of the TestManager group
Figure 3. The definition of the ClearQuest administrator's SuperAdmin group
Figure 4. Defining a Guest group
You can also set up a Guest group definition through which someone who is not a regular user on your project can access those defect records, if authorized by the ClearQuest Administrator.
Figure 5. Setting up a group for an individual tester
This sample definition of one tester group includes the member groups Guest and TestManager.
- Open ClearQuest Designer, log on to your target schema database, and check out the TestStudio template to edit. Add a new stateless record type called ACL (this step of the process is illustrated in Figures 6-11 following). This record type is used as the security context record type.
Figure 6. Adding a new stateless record type
Figure 7. The field definition of the ACL record type
Figure 8. The action definition of the ACL record type
Figure 9. The behavior definition of the ACL record type
Figure 10. The unique key definition of the ACL record type
Figure 11. The form definition of the ACL record type
- Modify the default Defect record type to add a new field to the defect record type. This field is used as a reference to the security context record, as shown in Figures 12 and 13.
Figure 12. The ACL field definition in the Defect record type
Figure 13. Setting the ACL field's behavior to USE_HOOK
- To automatically isolate defects, add a default value hook onto the reference field. Although ClearQuest supports two kinds of script languages (VBScript and Perl), note that the following script examples use Perl:
sub acl_DefaultValue { |
- Add a permission hook onto the reference field to set access control when changing a defect record.
sub acl_Permission { |
- Add an access control hook on the actions of the defect record type. What action this hook uses depends on your defect management process definition. In my example, I add this hook on the actions Modify, Delete, Duplicate, and Unduplicate. To better maintain and reuse code, I use record scripts to enhance code reusability.
An example of calling code in the access control hook of an action:
sub Defect_AccessControl { |
An example of calling code that is a record script called RS_AccessControl:
sub Defect_RS_AccessControl { |
- Modify access control of all actions on the ACL record type with user groups, as shown in Figure 14.
Figure 14. Setting access control
This shows that only members in the "SuperAdmin" group can operate on the ACL record type.
- Check in the schema and apply this design to your user database.
- Finally, the ClearQuest administrator needs to manually add some security context records, which are associated with each tester group (Figure 15).
Figure 15. The security context records
Note: in this design, the ACL record name should be exactly the same as the submitter's userid. For example, in Figure 15, if a submitter's userid is xiaming, then the corresponding ACL record name is also xiaming.
OK, that wasn't so hard, was it? Now you can try the design for yourself to see if the defect records are properly isolated by submitter. If the system is not accurately isolating the defects, retrace the steps and try again. Good luck!
Comments (Undergoing maintenance)





