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

  1. Pingback: Create secure sharepoint application page for site administrator - My experiments with SharePoint, Azure and .NET using Visual Studio

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.