Create secure sharepoint application page for site administrator

Home | SharePoint Development | Create secure sharepoint application page for site administrator

I’ve seen a question in msdn forum few days back, asking whether the sharepoint application page can be accessed only by the administrator. There is a simple way to achieve this. Whenever we create the secure application page in sharepoint, we need to override the property called RequireSiteAdministrator and return the value true. This would secure the application page in such a way that, it can be accessed only the site-administrator. Here is the code-snippet for the same. 

public class YourSampleApplicationPage : LayoutsPageBase {

  protected override bool RequireSiteAdministrator {
    get { return true; }
  }

  protected override void OnLoad(EventArgs e) {
    // any arbitrary logic goes here
  }
}

 Subscribe to my post

One thought on “Create secure sharepoint application page for site administrator

Leave a Reply