Skip to main content
Previous sectionNext section

Example Four: Matching and Target Roles

An application can temporarily add some of its users to a set of roles using matching and target roles. If the user is a member of the matching role when entering the application, the application adds the user to the target roles. When users exit the application, they lose their membership in the target roles.

The following example demonstrates creating a matching role and target role for the /csp/user application.

  1. Open the /csp/user CSP application definition.

  2. Click the Matching Roles tab. Then do the following:

    1. Select SecurityTutorialRole from the Select a matching role drop down list. Select a role from the Available column on the left of the form. In the example, %DB_DOCBOOK is selected.

    2. Click the arrow in the middle. This displays the role on the Selected column on the right.

    3. Click the Assign button.

    generated description: app cspapps9 20141

  3. The top half of the interface shows SecurityTutorialRole as a matching role and %DB_DOCBOOK as the target role.

    generated description: app cspapps10 20141

  4. Now open HomePage.cls in a Web browser. Enter JSmith for the user name and password and click Login. Since JSmith is a member of SecurityTutorialRole (the matching role), HomePage.cls displays %DB_DOCBOOK (the target role) among the roles that JSmith belongs to.

    generated description: app cspapps11 20111

Note:

If a user is already a member of a target role before entering the application, then the application does not assign the user to any new roles and does not remove the user from any roles.