Rights Management System Preparation
This section we say the characteristics of the privilege system, the system is the MVC4+EF5+IOC interface programming framework, where the permissions of the tree is Dwtree, the function of flexible, authorization control meticulous, permissions can be fine to the button level
, the design and coding are also more complex for simple deployment
The main functions of the system are as follows:
Custom action actions (such as additions, deletions, modifications, audits, etc.) are no longer the coarse grained allocation of permissions by the module, or a slightly more advanced point of the rule. Dead some operations.
Unlimited level function module management, custom module sorting, can better the whole system of all the modules for classification management.
Flexibly assign operations to each module, that is, what actions each module needs to be controlled (assign the operation added in step 1 to each module).
For all user base information management, the implementation of the expiration mechanism, expired automatic expiration, in the effective period can also force the user to stop using.
Custom roles, you can make a name that sounds easy to understand.
Any role can be any combination of system permissions function points (such as a module in which he can only modify the data and can not add or delete other operations)
A user can have more than one role (multiple identities), and a role can be owned by multiple users (the same identity) (many to many), flexible authorization.
Empowering users by role, when the number of authorized objects is large enough to be able to play (for example, to the company all staff authorized).
Assign roles by user, and you want to assign multiple roles when a user appears in the system in multiple identities.
The menu display is displayed according to the permissions, if a user owns more than one opcode permission for the module, the menu is displayed, otherwise it is not read
From the database structure, a total of seven tables (table) were designed, and the table name and function are as follows:
1. Module Management (Sysmodule)
System Menu management, support unlimited level tree, table our previous articles have been built
2. User table (Sysuser)
System member, login system only voucher
3. Role Group (Sysrole)
Manage the basic information of the role group. Users can customize to a variety of role groups, and then authorize the user
4. Module operation code (SYSMODULEOPERATE)
The parent table of the Operation code table is a module table, there are several operation codes under the module, such as Add, delete, audit, modify, etc.
5. Authorization Form (Sysrolesysuser)
Corresponding tables for user and role groups, a role with multiple users, and a user can have multiple roles
6. Role permission table (Sysright)
Associating a role with a permission point in the system completes the authorization action.
7. Permission to be paid to operate Code table (sysrightoperate)
The operation code of the role that holds the permission, and the corresponding menu is activated when an opcode is given permission.
We see the relationship between the table and the table through a physical model diagram
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/aspx/