About specifying user roles for forms

Microsoft Office InfoPath 2003

Show All Show All

About specifying user roles for forms

In Microsoft Office InfoPath 2003, you can assign users to distinct categories, called "user roles," which are based on job title or other criterion.

User roles are often used to present customized views of a form to different types of users. For example, a form that is used to collect feedback about job applicants might have three distinct user roles associated with it— one for recruiters, one for interviewers, and one for hiring managers. For each user role, you can present users with a slightly different view of the form.

Security  You should not use roles to restrict access to sensitive data in a form. Even if you make a form read-only or hide certain controls based on roles, users can potentially use a text editing program such as Microsoft Notepad to view or modify the form (.xml) file.

User role assignments

When designing a form, you can add, modify, or delete user roles by using the Manage User Roles dialog box.

When you create a new user role, you can assign users to it in the following ways:

  • By specifying user names (for example, "sales\andrew").
  • By specifying groups. For example, you can specify an e-mail distribution list that contains the names of all members of the marketing team.
  • By specifying user names that come directly from the form. For example, if your form contains a Manager text box, you can specify the field to which that text box is bound.

After you create a user role, you can set it as one of the following roles:

Default role   Users who are not assigned to an existing user role are automatically assigned to the user role that is specified as the default role. The default role is also used for users who are part of a group but who are working offline. One user role is always set as the default.

Initiator role   If you want to apply a particular user role to users who open your form for the first time, you can specify an initiator role. For example, you can define an initiator role named "Project Owner" that applies to users who fill out new project specification forms. A user who is assigned to a different user role is automatically reassigned to the project owner role when he or she opens a new project specification form. However, the next time that user opens the same form, InfoPath uses the person's assigned user role instead of the initiator role.

When a user opens a form, InfoPath determines whether that user is assigned to an existing user role. For example, if the user role assignments are determined by network name, InfoPath checks the user's name against the user's network credentials before opening the form. In the form, the name of the current user role appears on the status bar.

Working with user roles

After you define user roles for your form, you can set up a rule that automatically performs a task, such as switching views, based on events and values in the form. For example, you can create a manager user role and then create a rule to automatically switch the view when a manager opens the form. Alternatively, you can create the rule first and then define user roles as part of the process of creating the rule.

You can also vary a control's behavior based on a user role. For example, if your expense report form contains manager and employee roles, you can use conditional formatting to make the text inside a Total Expenses box turn red when employees accrue more than $500 in expenses or managers accrue more than $1,000. Similarly, you can vary the control's data validation or filter settings based on user role.

Testing user roles

If a form has multiple user roles, you can use the Preview Form With User Role command to test the appearance and behavior of each distinct role. For example, if you created a special summary view of your form for managers, along with a rule that switches the view based on user role, you can test that view with the manager role. In the preview window, the name of the current user role appears on the status bar.

When you test a form in the preview window, make note of the following:

  • Although you can preview a form to check that views work as you expect with user roles, you won't be able to simulate the process of evaluating a user against the user's given role assignment. That's because InfoPath checks user roles when you fill out the form, not when you preview it. If you want to fully test the user roles for your form, you can temporarily assign yourself to each user role that you want to test and then open the form as if you are going to fill it out.
  • If you click Preview Form on the Standard toolbar (or use the Preview Form Default command on the File menu) to preview your form, you'll see the view that's associated with the default user role in the preview window, regardless of your own role assignment. To preview other user roles, use the Preview Form With User Role command instead.

Note  The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed. Learn more