There is no natural relationship between functional departments and positions. For example, the manager must have greater power than the deputy. This assumption is not set
Set the permission table separately. This is a parallel structure and does not set the upper and lower level relationships between permissions. Can be grouped
Set a permission group table or role table, keeping only basic information
Set the relationship between permission groups or role information and permissions - "What kind of parallel permissions does a user group have?
Employee List
Company department table, tree structure
Company position list, tree structure
The one-to-many relationship between company positions and authority groups, that is, the default authority group for a certain position, can be associated with multiple
Employees are associated with departments and positions, multiple positions and multiple functions,
The relationship between employees and permission groups, that is, an employee can have permissions beyond the permissions of his position. You can consider setting a validity period At this point, starting from an employee, you can know who he works for Which department, what position is held, what permissions are shared - the union of the permission sets corresponding to the positions held
A user can only belong to one department, but can hold multiple positions at the same time. Users, departments, positions or roles, and user groups can all be assignees. Resources are associated with assignees, and priorities are set between various assignees. When there are high-priority assignee permission records, low-priority records are ignored. In addition, subordinate departments can inherit the authority of the superior department, but subordinate positions cannot inherit the authority of the superior position. Priority must also be considered for this.
There is no natural relationship between functional departments and positions. For example, the manager must have greater power than the deputy. This assumption is not set
Set the permission table separately. This is a parallel structure and does not set the upper and lower level relationships between permissions. Can be grouped
Set a permission group table or role table, keeping only basic information
Set the relationship between permission groups or role information and permissions - "What kind of parallel permissions does a user group have?
Employee List
Company department table, tree structure
Company position list, tree structure
The one-to-many relationship between company positions and authority groups, that is, the default authority group for a certain position, can be associated with multiple
Employees are associated with departments and positions, multiple positions and multiple functions,
The relationship between employees and permission groups, that is, an employee can have permissions beyond the permissions of his position. You can consider setting a validity period
At this point, starting from an employee, you can know who he works for Which department, what position is held, what permissions are shared - the union of the permission sets corresponding to the positions held
A user can only belong to one department, but can hold multiple positions at the same time.
Users, departments, positions or roles, and user groups can all be assignees. Resources are associated with assignees, and priorities are set between various assignees. When there are high-priority assignee permission records, low-priority records are ignored.
In addition, subordinate departments can inherit the authority of the superior department, but subordinate positions cannot inherit the authority of the superior position. Priority must also be considered for this.
General Manager->Director->Part Manager This is a very typical tree structure
Position table: id (position id) parent_id (parent id of the position)
Employee table: id (employee id) job_id (owned position id) 1 to many