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

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b370cf-e5b1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b370cf-e5b1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?