On the main page, I define a public property that toggles the security check, the default is true. I also declare a string, which is; list of sections required for this page.
in the loading page of my main page, I do the following
if (_secure)
{
if (Request.IsAuthenticated)
{
if (_role.Length > 0)
{
if (PortalSecurity.IsInRoles(_role))
{
return;
}
else
{
accessDenied = true;
}
}
else
{
return;
}
}
}
//do whatever you wanna do to people who dont have access.. bump to a login page or whatever
also you will need to put
at the top of your pages so you can access the advanced properties of the main page
source
share