Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Hi In a claims based SP site and we have multiple membership roles. I have lot of application pages in the layouts folder is there an effective way (apart from handling them in code behind) to authorize application pages in the layouts page based on roles (only certain membership role can view a particular page others will redirected to custom no access page). Any helpful suggestions and links would be very helpful. Thanks.

share|improve this question

2 Answers 2

If you can't find another answer besides the codebehind (I doubt you will) simply create a base class for your pages that applies the rule:

public class MembershipRoleLayoutsPageBase : LayoutsPageBase
{
     public override void OnInit(EventArgs e)
     {
          //check permissions, redirect otherwise
     }
}

On MyAppPage1.aspx

public class MyAppPage1 : MembershipRoleLayoutsPageBase  
{
  // page stuff
}
share|improve this answer

You can play with Web.Config and try applying ASP.NET Membership: Role Based Security..

As it was previously asked on Stack Overflow: Securing Application Pages in SharePoint 2010

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.