Scenario:
While designing Application pages we need to also consider security. We need to configure correct permission required to access the page.
Solution:
We usually inherit LayoutPageBase class for our application pages and it support various properties to handle such security. Override the RightRequired properties.
Code:
public override string PageToRedirectOnCancel
{
get
{
return "/_layouts/settings.aspx";
}
}
protected override SPBasePermissions RightsRequired
{
get
{
return SPBasePermissions.ManageWeb | SPBasePermissions.ManageLists ;
}
}
0 comments:
Post a Comment