ArticleDirectory
- 1. Business Objects and contacts in the permission Model
- 2. Business Object contact details
- 3 Summary
1. Business Objects and contacts in the permission Model
In the permission model, there are three objects: employees, positions (roles), and resources. The relationship between them is: there are many-to-many relationships between employees and positions, and there are also many-to-many relationships between positions and resources. That is, you can assign multiple positions to one employee, assign one position to multiple employees, and assign multiple resources to one position, you can also assign a position to multiple roles. The object relationship diagram is as follows:
2. Business Object contact details
Identifies the key attributes of the three objects and their relationships, such:
Employee: only manage employee information, not associated with roles;
Post: only manage job information. (If you need a parent job to access resources of a sub-job, you can design a job table as a tree structure data );
Resource: only resource information is managed separately. resources include pages and buttons, which are differentiated by type. The resources are designed as tree structures through parentid, levelno, and seqno;
Employeepermission: indicates the post of the employee;
Postpermission: indicates some post resources;
In this way, employees, roles, and resources can be managed separately, and the relationship between them can be managed in another table.
3 Summary
In the above model, we are just a simple modeling. We can improve other complex requirements based on this model. If you want to "view the job information held by Wang 'er from 2011-10-10", you need to change employeepermission to a history record table, that is, each time you modify the job information of an employee, we all save it, but at some point we only use one of the data. Add the isuse identifier. This is actually the simplest permission model that has not yet been added to the need for multiple companies and departments. We will discuss more about these requirements and how the existing permission model evolves.