Configuration

In order to setup security for your application, you must define your users and roles.

User Definitions

Each user definition must include a password, one or more role definitions and optional substitutions. You may define your users either in an XML file or by implementing a subclass of the GmsCustomUserManager. See “Custom User Manager” for more information.

Defining Users in an XML File

By default, RTView will look for user definitions in a file named users.xml in the directory where your application or applet started. You may specify another file name or path for your user definition file in the “Security Tab” of the Display Builder Application Options dialog.

The user definition file must be an XML file and must start with the following:

<?xml version="1.0"?>

<users xmlns="www.sl.com" >

The user definition file must end with the following:

</users>

The following tags are supported:

User

name

The user name.

password

The password for the user

role

The role(s) for this user. You may assign multiple roles per user.

Note: The role must have a corresponding role definition. Each user must have at least one role. See “Role Definitions” for more information.

sub

Set initial substitutions for this user, specifying name and value. In addition, RTView automatically defines the following substitution for each user when the application is started with the login dialog:

$rtvuser - user's login name

Substitutions are optional and must use the following syntax:

<sub name="$sub1" value="value1" />

<sub name="$sub2" value="value2" />

Examples

User definition:

<?xml version="1.0"?>

<users xmlns="www.sl.com" >

           <user>

                        <name>user name</name>

                        <password>user password</password>

                      <sub name="$sub1" value="value1" />

                        <sub name="$sub2" value="value2" />

                        <role>user role1</role>

                        <role>user role2</role>

          </user>

</users>

When creating your users definition file, the passwords can be entered in plain text. You can then re-save your user file with the passwords encrypted by using the -saveusers command line option with the Display Builder, Display Viewer.

Note: This option will only work if you are logged in as the admin role.

Role Definitions

Use role definitions to permit and deny access to displays based on a user's role. Specify each displays you wish to permit or deny in the include and exclude lists (respectively), and optionally specify substitutions. The displays that are on the role definition exclude list are removed when a user assigned to that role logs in.

Note: By default, all displays are excluded. You may define your roles either in an XML file or by implementing a subclass of the GmsCustomRoleManager. See “Custom Role Manager” for more information.

Defining Roles in an XML File

By default, RTView will look for role definitions in a file named roles.xml in the directory where your application or applet started. You may specify another file name or path for your role definition file in the “Security Tab” of the Display Builder Application Options dialog.

The role definition file must be an XML file and must start with the following:

<?xml version="1.0"?>

<roles xmlns="www.sl.com" >

The role definition file must end with the following:

</roles>

The following tags are supported.

Role

name

The role name.

displays--include

The name of a display to include for this role. * is supported as a wildcard character, but only one * per display name is allowed. Specify ALL for the display name to include all displays.

displays--exclude

The name of a display to exclude for this role. * is supported as a wildcard character, but only one * per display name is allowed.

sub

Set initial substitutions for this role, specifying name and value. In addition, RTView automatically defines the following substitution for each role when the application is started with the login dialog:

$rtvrole - user's role

Substitutions are optional and must use the following syntax:

<sub name="rolesub1" value="value1"/>

<sub name="rolesub2" value="value2"/>

Examples 

Role definition:

<?xml version="1.0"?>

<roles xmlns="www.sl.com" >

          <role>

                       <name>operator</name>

                       <displays>

                                   <include>ALL</include>

                                   <exclude>admin*.rtv</exclude>

                                  <sub name="rolesub1" value="value1"/>

                                   <sub name="rolesub2" value="value2"/>

                      </displays>

         </role>

</roles>

The displays listed for each role are processed in reverse order, so the last display listed takes precedence over all others. So, in the example above, displays starting with admin are excluded, but all other displays are included. If the lines were reversed, all displays would be included, even those starting with admin.