Auth_items: feature is used to record objects in RBAC.Field: Name-holds object name, string; Type-object type, (0, 1, 2); Description-related description, long string; BizRule-long string, where you can define a PHP code block to enhance the extensibility of validation; data-long character String, after the serialized array. Used to provide parameters for BizRule, where the value of the Type field means 0-operation Action 1-task task 2-role role auth_assignments: function record user-role corres
When the relationship between these 5 tables is cleared, the next step is to introduce the functions.Basic will follow this idea, as an introduction.A. Adding a roleSome notes:1. The role name, that is, the corresponding job title, such as programmers, architects, and so on, each title will have corresponding permissions, in the same vein, different roles have different corresponding permissions.2. Role description, (do not assume that the role of a certain description, a, what is it, B is what,
or modify the administrator's management group;650) this.width=650; "title=" Bai Jun Haruka Blog "src=" Http://baijunyao.com/Upload/image/ueditor/20160514/1463186391769769.jpg " alt= "Bai Jun Remote Blog" style= "border:0px;"/>When such a structure is built, the rights management is simply the AdminBaseController.class.php of the following code;/application/common/controller/adminbasecontroller.class.php$auth =new \think\auth (); $rule _name=module_name. ' /‘. Controller_name. ' /‘. action_name
administrator or modify the administrator's management group;When such a structure is built, the rights management is simply the AdminBaseController.class.php of the following code;/application/common/controller/adminbasecontroller.class.php$auth =new \think\auth ();$rule _name=module_name. ' /‘. Controller_name. ' /‘. Action_name;$result = $auth->check ($rule _name,$_session[' user '] [' id ']);if (! $result) {$this->error (' You do not have permission to access ');}This is also in the thinkph
administrator or modify the administrator's management group;When such a structure is built, the rights management is simply the AdminBaseController.class.php of the following code;/application/common/controller/adminbasecontroller.class.php$auth =new \think\auth ();$rule _name=module_name. ' /‘. Controller_name. ' /‘. Action_name;$result = $auth->check ($rule _name,$_session[' user '] [' id ']);if (! $result) {$this->error (' You do not have permission to access ');}This is also in the thinkph
administrators, can add the administrator or modify the administrator's management group;650) this.width=650, "title=" Bai Jun Remote Blog "src=" http://www.baijunyao.com/Upload/image/ueditor/20160514/1463186391769769. JPG "alt=" Bai Jun Remote Blog "style=" border:0px; "/>When such a structure is built, the rights management is simply the AdminBaseController.class.php of the following code;/application/common/controller/adminbasecontroller.class.php$auth =new \think\auth (); $rule _name=module
I see Thinkphp3.1.3 's video is written but not realized! Ask God for help
Reply content:
I see Thinkphp3.1.3 's video is written but not realized! Ask God for help
The RBAC encapsulation class is placed in the OrgUtilRbac.class.phpRefer to:
Http://www.tuicool.com/articl ...
Configuration file, such as application/common/config/config.php or application/admin/config/config.php under the module. Build a public controller, such as CommomC
Administrator tableCREATE TABLE cqh_privilege (id mediumint unsigned NOT NULL auto_increment comment ' id ', pri_name varchar (+) NOT NULL Commen T ' permission name ', Module_name varchar (+) NOT null comment ' corresponding module name ', Controller_name varchar (+) NOT NULL comment ' corresponding controller name ', Action_ Name varchar (0) is not null comment ' corresponding method name ', parent_id mediumint unsigned NOT null ' ID ' of the ' ancestor ', ' comment key ' primary ' (ID)) Engin
There's a problem with the backstage process.
Using Thinkphp's own RBAC.
Check permissions in each Basecontroller
Output pages with no permissions when no permissions are granted
However, if the button is clicked, no permission is on the front page without any feedback. Only the F12 developer tool can see
So, how to judge to have no permissions, there is the right way to return, if the page let him into the page without permission, if it is a button
For more information, see a rbac SQL script (2) http://blog.csdn.net/enjoyo/archive/2007/07/21/1701641.aspx.
This is the script for Derby (it can be used as a reference for learning the Derby database)
--*************************************** *****************************
-- Membership SQL
Derby
--
-- INSTALLThe tables and initialize the membership data
-- Supporting the Java project and Hibernate
--
-- Author: Kevin Yin
Http://
'), null, false);
6. Route Filter
Entrust roles/permissions can be applied to the filter by invoking the can and Hasrole methods on the entrust façade:
Route::filter (' manage_posts ', function () { //Check the current user if (! Entrust::can (' Create-post ')) { return redirect::to (' admin ');} }); /only the user corresponding role has ' manage_posts ' permission to access any admin/post route route::when (' admin/post* ', ' manage_posts ');
Use filters to check for
the three entity tables. The difficulty lies in understanding the work of ing tables, recording the relationships, and implementing the concept of "group" operations. The overall system design is based on the ability to "reuse" in different MIS systems to meet the functional permission settings of different systems.
Appendix:
Field Design of permission management system data table
Let's take a look at the database table design of the permission management system, which is divided into six ta
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.