To implement the authorization, you need three tables for managing users, roles, and rights in the database, each of which is connected to the others by an n:m relation. The wizard allows you to generate the appropriate entities. In addition, the entities are connected by mapping. This allows RapidClipse to handle entities and attributes of any name. If the default mapping does not match your data structure, you can define custom queries.

Even if you use the authentication via LDAP, you have to save the users in a database table to connect users and roles with each other. Users and roles must be synchronized at runtime.

Define/generate resource table

  1. Entity for rights already exists: Select your existing entity.
    No Resource Entity available yet: Click New Entity... to create a new Resource entity, including ResourceDAO DAO. 
  2. Select the respective attribute for the user rights Mapping > Resource name.
  3. Click Next >.
Options:
Note:
Result:

Define/generate roles table

  1. Table for roles (Roles) already exists - Select your existing Role entity.
    No role entity exists yet - Click New Entity... to create a new Role entity including the RoleDAO
  2. Select the attribute for saving the roles under Mapping > Role name
  3. Select the attribute for saving the rights under Mapping > Resources
  4. Select the attribute for saving the sub roles in Mapping > Child roles.
  5. Click Next >.
Options:
Note:
Result:

Connecting Users and Roles

  1. Table for users (User) already exists - Select your already existing User entity.
    No user entity exists yet - Click New Entity... to create a new users entity.
  2. Select the attribute for the user name in Mapping > Subject name.
  3. Click Mapping > Roles and then click Create Attribute, to enhance the entity User with an attribute that connects the  User and Roles attributes to each other.
  4. Click on Finish.
Options:
Result:

Create database tables

It is necessary to create appropriate tables in the database that match the newly generated User, Role and Resource entities in the database.

Entity > Database Export (Create tables)

Enter default data

For database tables, it is helpful to enter some default data in the UserRole, and Resource entities.

Data Source Explorer