Access to pages can be restricted by user roles with the “Roles” property. Any user that does not belong to a specified list of roles will not see the page in the navigation menu or be able to access the page by URL.
The Categories | Products page is visible for all authorized users in a default web application created from Northwind database. Let’s configure this page to only be visible for users with the role of “Administrators”.
Start the Project Designer. In the Project Explorer, double-click on Categories / Products page node.
Change the Roles property:
Property | Value |
Roles | Administrators |
Press OK to save. On the toolbar, press Browse.
Log in using the standard user account (user / user123%). The Products page will not be available in the navigation menu.
If the URL is accessed directly (~/Pages/Products.aspx), the application will redirect you to the Home page.
Log in with the administrative account (admin / admin123%). The page will now be available.