A layout page access can be restricted to only Site Administrator by overriding the RequireSiteAdministrator property of LayoutsPageBase class.
The below code snippet shows sample implementation.
using Microsoft.SharePoint.WebControls;
public class MyLayoutPage : LayoutsPageBase
{
//It mmakes sure only site administrators can access this page
protected override bool RequireSiteAdministrator
{
get
{
return true;
}
}
protected void Page_Load(object sender, EventArgs e)
{
//Code goes here...
}
}
It is just one of the members, look at the post here to know about many other members/methods of LayoutsPageBase class.
No comments:
Post a Comment