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:
b:
1. Query out all parent permissions and sub-permissions, and cycle output in the view layer;
2. Pass the parameters, corresponding to the id of the role name and permission auth_id;
3. Use AJAX to asynchronously submit data to the controller;
4. The controller receives the data and sends it to the model to process business logic;
5. Start distribution;
In order to realize the function that the assigned permissions are selected, use if to judge;
first query the data, and then judge;
After that, the assigned permissions will be selected.