Share the permissions of the Framework website System. especially for large projects and secondary development projects, the user table is a user table. it does not matter if tens of thousands of users can be stored, the groupid behind is 1, which is the administrator permission. 2 is the method name of the model table storage framework for the visitor permission. The group behind it is the set type, which group has this permission ;? PhpclassIndexActio shares the permissions of the Framework website system, especially for large projects and secondary development projects.
The user table is the user table, and it does not matter if tens of thousands of users can be stored. the groupid below is 1, which is the administrator permission, and 2 is the tourist permission.
Name of each method in the model table storage framework. The group behind it is the set type, which indicates which group has this permission
Look at the sample code.
PHP code
Find ("user", "string", "user = '". $ user. "'"); $ group_tmp = $ data ["groupid"]; $ this-> show ($ group_tmp);} public function show ($ group_tmp) {$ list = $ this-> find ("model", "string", "func = 'show '"); $ SQL = "select * from model where func = 'show 'and find_in_set (". $ group_tmp. ",". $ list ['group']. ")"; if (mysql_num_rows (mysql_query ($ SQL) {echo "permission passed"; // process the following content} else {echo "no permission ";}} public function showAll ($ group_tmp) {$ List = $ this-> find ("model", "string", "func = 'showall '"); $ SQL = "select * from model where func = 'wall' and find_in_set (". $ group_tmp. ",". $ list ['group']. ")"; if (mysql_num_rows (mysql_query ($ SQL) {echo "permission passed "; // process the following content} else {echo "no permission" ;}}}?>
For more information, see...
------ Solution --------------------
The model name must be added to the model table. otherwise, different models cannot be distinguished from methods with the same name.