Laravel online education development __ permission assignment

Permission allocation for online education development

For better management, RBAC authority management is implemented for administrators. RBAC: Role-Based Access Control, role-based access control. It is a relatively complete authority access control mechanism. There are currently 2 sets of permission control schemes: user-based permission control and role-based permission control.

a. RBAC is very convenient in the maintenance of later permissions;
b. RBAC permissions have a standard in the initial stage of project development;

Therefore, in the background of many large projects, the permission method is the rbac permission control method.

a:
Insert picture description hereb:
Insert picture description here

1. Query out all parent permissions and sub-permissions, and cycle output in the view layer;

Insert picture description here
Insert picture description here

2. Pass the parameters, corresponding to the id of the role name and permission auth_id;

Insert picture description here
3. Use AJAX to asynchronously submit data to the controller;

Insert picture description here

4. The controller receives the data and sends it to the model to process business logic;

Insert picture description hereInsert picture description here

5. Start distribution;

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
In order to realize the function that the assigned permissions are selected, use if to judge;
first query the data, and then judge;

Insert picture description here

Insert picture description here
After that, the assigned permissions will be selected.

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_44796093/article/details/108431193