ArticleDirectory
- 1 Introduction
- 2. New Requirements: Organizational Structure
- 3. Permission model after the organizational structure is added
- 4. Summary
1 Introduction
Next, I wrote "Database Design Series [03] Permission System" in the previous article. In the previous article, I just briefly introduced the role-based and operational access control model to control permissions to pages and buttons. CDM diagram:
2. New Requirements: Organizational Structure
For example, a large mobile phone sales company has such a department position structure:
The following requirements are available:
1> require users to assign permissions by Apple department manager and Nokia department manager... Rather than a department manager;
2> require statistics on the sales performance of Apple department managers and Nokia department managers;
When these requirements are met, the permission model in the previous article cannot meet the requirements.
3. Permission model after the organizational structure is added
We do not consider the department information first, so that only the position information is left in the above structure diagram. The first response to this requirement modeling is to build a post tree structure. However, Apple's department manager and Nokia department manager have two completely different roles and resource entity associations, and their associations are the same, resulting in data redundancy. If the position structure is small, this is not a problem. CDM:
This permission model is no different from the previous model. It only makes the post into a tree structure to meet new requirements.
3.2
However, if the organizational structure is very large, the job entity and the job permission entity will also become very large, and it will be difficult to configure the permission.
In the organization chart, we can see that Apple department managers and Nokia department managers are at the same job level, that is, they are an example of department managers. For example, ** sales personnel are sales personnel. Therefore, there is a job instance entity, and they have a parent node relationship. Finally, you can assign job instances to users. CDM:
Postorganization: stores the information of the job instance, that is, the post structure diagram above.
3.3 Add Department Information
Tired, directly, do not explain>. <. CDM:
In this model, we can solve this problem: when there are new customers in the Apple department, we can email all the people in the department.
4. Summary
This article mainly discusses how to add the organization structure information to the permission system. This article is just a reference. What's wrong, what's wrong, and what's wrong? I hope you can give me some advice.