Home > Net >  Rights management operation
Rights management operation

Time:10-05

Rights management operation
The users table: a user's specific information, such as name, age
Role table: has the role of the current system, such as the administrator
Permissions table: role may all permissions, such as delete, modify
Role authorization table: correlation character table and permissions table
User role table: user tables associated with role table
Associated by the user roles and permissions, in a nutshell, a user has several roles, each role has a number of privileges, such, is constructed as "user privilege - character -" authorization model, in this model, users and roles, roles and permissions, are generally not a many-to-many relationship,
For example:
- create user information table
The create table the UserInfo
(
UID int primary key identity (1, 1), - the primary key to add
The UserName varchar (100), - the user name
PassWord varchar (100), - PassWord
IsDel bit - whether delete
Whether IsLock bit - lock
AddDate datetime, increase time
TrueName varchar (100), users - real name
)
- the system character information table
The create table RoleInfo
(
Rids int primary key - primary keys
RoleName varchar (50), - character name
RoleDescribe varchar (100), - character description
)
- management system permissions page table
The create table PerMission
(
PID int primary key - primary keys
PerMissionName varchar (50), -- authority name
PerMissionUrl varchar (Max), - permissions link
PerMissionDescribe varchar (Max), - permissions description
PerMissionParent int, permissions - father description
PerMissionSortld int, sorting,
)
Go
- role authorization relational table
The create table R_RoleInfo_PerMission
(
RRPId int, - the primary key to add
Rids int, - character number
PId, int - access number
)
Go
The create table R_UserInfo_RoleInfo
(
RURId int identity (1, 1), - the primary key to add
UId int, - the user number
Rids int, - character number
)
Go
  • Related