Tutorial - Advanced Security - Static User Level Security In this tutorial we will show you how to setup static User Level Security in ASP.NET Maker. We will use the demo database for demonstration. User Level There are 2 types of User Level security: 1. Static User Levels - the User Levels and the permissions are defined in the project and the User Levels are not to be changed after script generation. In this tutorial we use static User Level Security. The "Employees" table and "Orders" table in the demo database will be used in this example. Fields in Table "Employees" Fields in Table "Orders" Steps to Setup Static User level Security 1. Loading ASP.NET Maker Open ASP.NET Maker and connect to the demo database. 2. Setting up User Access Levels Click on the [Security] tab, there are two sections for the login process: Administrator Login Use Existing Table To set up the user levels, click on the [Advanced] button. A popup window will appear. Click on the [User Levels] button. Select the User Level Field.
There are two built-in user levels:
Click to add a new user level. Enter the description, and default permissions. Click OK to finish. For each user level, you can set refine the permission for different tables/views. Click OK to finish. If you go to Field Setup Page now and view the Edit Tag for the User Level Field, you should see that the Edit Tag has been setup as "SELECT" and the user levels have been added automatically in the value list:
3. ASP.NET Script Generation Click the [Generate] button and ASP.NET Maker will generate the required ASP.NET scripts automatically. 4. Running the ASP.NET Application To assign different user level for the users, login as Administrator and go to the user table (the "Employees" table in this case). You'll find that the Edit Tag of the User Level Field is setup as "SELECT" (combobox) and the combobox is populated with the user levels we defined above automatically. We assign a password and the user level "Sales" to the employee #1 (the employee with EmployeeID equals 1). Then we logout. To see the Advanced Security works, we login again as employee #1 using "nancy" as user name and "1234" as password. According to the user level defined by us, users with "Sales"
level has view and add permissions to the "Orders" table only.
They are not allowed to update or delete records. Employee #1 belongs
to the "Sales" level, so we do not see the links to the edit/delete
page.
Notes:
Also see: Advanced Security - User ID Security
|
©2004-2011 e.World Technology Ltd. All rights reserved. |