First, preface
This paper mainly describes the design of user-role-authority database in OA system design, in order to realize the distribution of rights.
Second, preliminary analysis
User login to the system through the UI, the user's user name, password passed to the background to determine whether there are user information available in the user table, if there is a jump to allow the page, and set some session information, when the page jumps according to the user's session information to obtain the user's role, Further, according to the role to obtain the user's operation permissions, here the operation permissions include the role can manipulate the menu, and the menu corresponding to the action button.
The above description can be used to analyze the data tables contained in the system have t_users (user table), T_roles (role table), R_userrole (User role Relationship table), T_menus (menu table), T_button (button table) and
R_privilege (Role, menu, button Relationship table), R_menubutton (menu button Relationship table), total seven sheets. In order to make the article more positive, for other and this article analysis of the problem of irrelevant data tables such as T_DEPRT (department table) and so omitted.
The relationships of these tables are analyzed by physical model diagrams below:
All of the tables above omit some data fields that do not necessarily exist for the analysis problem. These necessary fields believe that the developer can know what it means, so don't explain it.
It is necessary to note that the primary key in the table associated with all relational tables (tables that begin with "R_") is an N: Special instructions Here are the Objectid, OBJECTDESCR in the R_privilege table. Because the permission table needs both the corresponding menu and the corresponding additions and deletions to the
button, so the value of Objectid is MenuID or Menubuttonid, so the corresponding OBJECTDESCR is menu and button.
When the user logs in, the Roleid corresponding objectid=t_menu.menuid of the role is obtained according to the condition objectdescr= ' menu ', which can get the Operation menu.
When a page is opened, the Roleid corresponding Objectid=r_menubutton.menubuttonid of the role is obtained according to the condition objectdescr= ' button ', which allows the user to Btnid the action button on the relevant page.
Third, the conclusion above is about the theme of the analysis, hope can be a point.
Design the user-role-permission assignment for OA system