BlogEngine.Net: Page Level Security

by Xavier Pacheco 23. August 2009 13:17

I needed a way to achieve page-level security for a BlogEngine.net deployment. Brian Carter on his blog provides a pretty good solution with a user control that you simply put on the page you want to secure.  You’ll find it here: BE.N Page Security User Control. One modification I had to make was to the SecurityRole.ascx.cs file. The Page_Load even contains logic to redirect a user to the login page if that user does not belong to the role specified in the user control parameter (see his website for instructions). I simply modified the path to my own page as shown below.

            if (!isInRole) Response.Redirect("~/page/LeaderNot.aspx");
 

Have fun!

Tags:

ASP.NET | .NET | BlogEngine.NET | C#

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



This site is Hosted by WebHost4Life

Join WebHost4Life.com

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010 X Talks Tech