Anye project: authority control

xiaoxiao2021-03-06  114

In the anya project, Microsoft's TreeView is used to press, so the most important amount of permissions is to control the nodes to be displayed on TreeView, which use four tables, XT_Menu (menu table), XTuser (user table), XT_JSMX (role chart), XT_QXMX (permissions clear table) as shown:

The user_role in the user table is used to determine the role of the login user. JS_BH in the role schedule is associated with the JS_BH association in the permissions clear table to determine the permissions of the role, and then according to the enabled and menu in the permissions. The MNU_xh association in the table determines the menu.

The stored procedure used in the project below. CREATE PROCEDURE ay_proc_xtmenu @usernc varchar (20) ASbeginSELECT DISTINCT xt_menu.mnu_xh, xt_menu.mnu_fbm, xt_menu.mnu_name, xt_menu.mnu_url, xt_menu.mnu_img, xt_menu.mnu_seq, xt_menu.mnu_end, xt_menu.mnu_lbFROM xt_qxmx INNER JOIN xt_jsmx ON xt_qxmx.js_bh = XT_JSMX.JS_BH INNER JOIN XTUSER ON XT_JSMX.JS_BH = XTUSER.USER_ROLE INNER JOIN XT_MENU ON XT_QXMX.ENABLED LIKE XT_MENU.MNU_XH '%' Where XTuser.user_nc=@uSerncorder by MNU_Xhendgo

As for the generation of the tree, you can refer to "Bastro-spanning tree: dynamic from the database" article.

转载请注明原文地址:https://www.9cbs.com/read-99615.html

New Post(0)