Php is based on auth user authentication, how to allocate permissions according to the employees of the enterprise?

uses the thinkphp framework for authority authentication based on auth.
currently there are four tables in mysql:
1, user (user table)
2, auth_group (user group table, such as administrator group, employee group)
3, auth_group_access (previous association table between user and user group)
3, auth_rule (rule table, controlled based on "/ module / controller / action")

requirements: users can assign permissions according to the structure and position of the enterprise
for example: CRM customer management
1, salespeople can access customer information under their own names
2, sales managers can access all customer information under their employees

what is the idea of implementation?

Feb.10,2022

you actually have some organizational structure information in it. This design is good at adding permissions


different user groups of salespeople and sales managers, you can add where conditions according to the different judgments of auth_group.id, as long as you have the corresponding relationship table between the sales manager and your employees

.
Menu