-
Typical steps regarding the design of permissions.
1. In the user table, there is a field in the user table that records the role number in the role table.
2. The role table records the name of the role.
3. Function menu table, record menu.
4. Role-corresponding function table (menu);
In this way, when a user logs in, first confirm whether the user is valid by the user name and password, if it is valid, then query out the user's role, and then put all the function menus into the corresponding menu display position according to the available menu corresponding to the role;
There are several key points here, the role function table is the most critical, and the role function table should have the role number, menu number, and whether the menu is available or not.
When adding a new menu, use the inert trigger to insert the corresponding relationship between this menu and all roles (already in the role table) into the role corresponding function table, so that the usable can be marked as unavailable; It can be authorized afterwards;
When adding a new role, use the insert trigger to insert the correspondence between the role and all the menus in the menu table into the corresponding function table of the role, and you can also make the usable mark as unavailable; It can be authorized afterwards;
Through the above two steps, you will associate a character with all menus, and determine whether this menu is available by controlling whether it is available or not.
The above is the most complete solution idea, if not, it can give you a piece of source code and table structure.
I am the technical director of a software company, engaged in the development of large-scale database systems in the mobile communication industry, and have eight years of experience in databases, data warehousing, data conversion, heterogeneous database migration, etc. It's mine.
-
Please add points to me Thank you.
-
To view the SQL statement of a stored procedure, perform the following steps:
1. Open the Microsoft SQL Server database management tool and enter the password to connect to the database.
2. If there are multiple databases on the database server, select the database we want to view, and its options.
3. In the database menu, find the 'Programmability' menu and set it.
4. Under the 'Programmability' menu, find 'Stored Procedure' and click the '+' sign in front of it to let it. Here you can see the stored procedures that come with the system and the stored procedures compiled by the user.
5. Right-click on the name of the stored procedure to be managed, and select: 'Script stored procedure as' --alter to '--New Querier Window'. This action is to modify the stored procedure.
6. At this time, we can clearly see the ** of this stored process, which can be modified, and remember to save it after modification to take effect.
-
The implementation method and detailed operation steps are as follows:
1. The first step is to create a stored procedure, which is shown in the figure. The main purpose of the stored procedure is to insert new data for the table "jingyan", as shown in the following figure, and then move on to the next step.
2. Secondly, after completing the above steps, execute the following lines** and check whether the execution is successful. Now there is a stored procedure source "sp jy" in the database, as shown in the following image, and then move on to the next step.
3. Then, after completing the above steps, look at the current array in the "jingyan" table, there are only three rows of data, as shown in the following figure, and then enter the next step.
4. Then, after completing the above steps, in MySQL, to call the stored procedure, just use the "call" keyword and enter the name of the stored procedure. Of course, if there is a parameter, you need to bring one. **See the image below and proceed to the next step.
5. Subsequently, after completing the above steps, check the data in the "jingyan" table again, and you can see that the current data is already four, which indicates that the call to the stored procedure has successfully inserted the new data, as shown in the following figure, and then enter the next step.
6. Then, after completing the above steps, add another stored procedure, which uses the select statement to return the table data, as shown in the following figure, and then proceed to the next step.
7. Finally, after completing the above steps, call a new stored procedure, and you can see that the table data has been returned in the result, as shown in the following figure. In this way, the problem is solved.
sql2000
In the start-program-microsoftsqlserver-enterprise manager interface, open the console root file and record all the numbers to (local) (windowsnt), which has the database, data conversion service. Wait, you can right-click "New Database" in "Database" and you're done. >>>More
The complete process of cognition: practice - understanding - practice; Practice to Know: Perceptual Knowing. >>>More
By looking at the current income and the annual cumulative income on the income statement, the company's annual turnover is the company's annual turnover, including main business income and other business income. >>>More
The lessons of plants are as follows:1. Thatch and saw. Legend has it that more than 2,000 years ago, Master Luban once went up the mountain to cut down a tree, and unintentionally when Xun Weizhong was cut by a thatch, he felt very strange, why did the tender grass break the calloused hand and bleed? >>>More
select city, sum(nvl(,0)) number of disconnection alarms, sum(nvl(,0)) number of alarm exceeding the standard, sum(nvl(,0)) number of abnormal alarms. >>>More