Permanent history entry (PHE)
Allows limiting the application's content to the tables associated with a user's login
Topics
Use case
In Hotel Management System the managers just have access to the hotel that manages.
Goal: Limit access to the table HOTEL in your database for different roles/levels.
- The logins table (PSW) and a limit table (HOTEL) are used for this purpose
Association table
The EPH structure:
HOW TO CREATE?
- Create a N:N table between the PSW table and the HOTEL table.
- Go to History Menu (1), insert a new PHE (2)
- First, you should give an identifier name, then refer to the N:N table.
- You need to specify what value to input from this N:N table, in this example, is CODHOTEL.
EPH Definition
- The method to obtain the value from PHE is equal by default, this means that the system will limit the users that belong to that hotel.
- However, you can choose other types of operators to apply to the PHE.
- You can have more than one PHE. By default the operator between them is AND, however, you can tick the option OR.
- The option “Propagate in-depth” allows you to propagate the PHE to all areas below the defined area, but this spends a lot of resources.
Applying to roles/levels
- Inside the role or the level, you can insert the PHE.
Role
Level
Notes
The association table created between the PSW table and the HOTEL table will allow the administrator to do the association between the user (created in Webadmin) and the hotel (created in the application).
- First, create the association table form and use it in the menu or as a table list inside the hotel.
- In the Webadmin solution create a user and give it "manager" or the role/level with EPH.
- In the application insert the hotels and define the relations between the managers and the hotels.
- After the login with the manager, you can see that will just have access to his hotel.