Good to know. Thank you Sliderhouserules I'm looking forward to that. Also I want to thank you Angus for the response to my email in which he stated and I'll paraphrase:
--------------------------------------------
You can simply create base functions in your controller that check user security permissions for example:
- isSiteAdmin()
- isCustomer()
- isShopUser()
- isCustomerAdmin()
Then create a logic trap at beginning of methods that need to be secured. (He used VB I'll translate to C# as I'm more familiar with the syntax)
if ( isAdmin() ) {
Throw New System.Security.SecurityException("Access Denied. User is unable to view this page.");
}
RenderView("Index"); --------------------------------------------
Alternatively you could also (I took this from Maarten Balliauw) http://blog.maartenballiauw.be/post/2007/12/ASPNET-MVC-framework---Security.aspx
try {
PrincipalPermission permission = new PrincipalPermission(User.Identity.Name, "Administrators", true);
permission.Demand();
} catch (SecurityException secEx) {
// Handle the Exception here...
// Redirect to Login page, for example.
}
But I personally like Angus's method better. Anyway this is just me trying to give back because of the great answers I receive from people willing to take time out and help our professions.