|
Role-based security requires users to belong to different roles. Based on the roles assigned to individual users,
they are granted access to specific pages that permit access for those roles. Your database will need a table that
identifies the role(s) assigned to each user.
Iron Speed Designer supports two different styles of user-assigned roles:
- User has only one assigned role. Each user has one and only one role assigned to him. The role assignment can be placed either in the User Table (see previous section) or in a separate Roles Table.
- User has multiple assigned roles. Each user can have zero or more roles assigned to him. The role assignments are in a separate Roles Table, effectively creating a one-to-many relationship between each individual user in the User Table and multiple corresponding entries in the Roles table.
If you are implementing role-based security, Iron Speed Designer requires one table in your database to be
designated as a “Roles Table”. The Roles Table contains a list of your application’s users and their respective
roles. The Roles Table can be any table in your application, including the User Table. Within this table, you must
have two important fields from which Iron Speed Designer builds the role-based mechanism in your application:
| Field |
Description |
| User Roles table |
The table containing the list of user roles. Note: Only a subset of the tables and database views in your database are visible in the User Roles Table field. By default, only those tables used by Application Wizard (for generating pages) are available in the Role-Based Security Wizard. To make other tables appear in this dropdown list, check the "Include table/view in application" option for each table desired in the Databases folder in Application Explorer for each additional table you wish to appear. |
| User ID Field |
The User ID Field designates the field in the Roles Table that uniquely identifies each user. |
| Role ID Field |
The Role ID Field designates the field containing the role assigned to the user. |
Placing Role Information in Your User Table
In situations where an individual user has only one assigned role, the role assignment is usually maintained
in the User Table directly, although there is no requirement that this information be in the User Table.
Placing Role Information in a Separate Roles Table
In systems where individual users can have multiple assigned roles, the role information must be maintained
in a separate roles table. A one-to-many relationship exists between each individual user in the User Table
and multiple corresponding entries in the Roles table.
Iron Speed Designer generates application code for both of these scenarios based on how you identify the
location of the role information in your database.
Selecting the Roles Table
In the Role-Based Security Wizard, make these selections:
| Field |
Description |
| User ID Field |
The User ID Field designates the field in the Roles Table that uniquely identifies each user. |
| Role ID Field |
The Role ID Field designates the field containing the role assigned to the user. |
|