Xerratus
Happily stressed out, since 1974


 
Wednesday, October 05, 2005
<< Daily Dumbass
Css and the dasBlog calendar control >>

Come on!  Can't we comment code and be nice at the same time?

   public static void ValidateUserAccess(SoftwareAppType appType,params string[] roles)
{
//-- TODO: Take this out! it's only for devlopment purposes stupid. #if DEBUG
if(ConfigurationManager.AppSettings["RequireLicenses"] != null)
{
if(!Convert.ToBoolean(ConfigurationManager.AppSettings["RequireLicenses"])) return;
}
#endif //-- ensure the user has sufficent permissions bool hasRole = false;
foreach(string role in roles)
{

if(!HttpContext.Current.User.IsInRole(role))
{
hasRole = true;
break;
}
}

if(!hasRole)
HttpContext.Current.Response.Redirect(URL.NoAccess + "?code=" + ValidationError.InsufficientRole);

if((!SecurityManager.GetLicense(appType)))
HttpContext.Current.Response.Redirect(URL.NoAccess + "?code=" + ValidationError.LicenseNotAvailable);

}
Wednesday, October 05, 2005 12:01:22 PM (Pacific Standard Time, UTC-08:00)
Ouch!! Well.. its nice to see that you have VS.NET open at least... ;)
chicanito33
Wednesday, October 05, 2005 12:13:07 PM (Pacific Standard Time, UTC-08:00)
That was from Montana boy. I thought it was odd how he commented some things, not all but a few comments of his just had me wondering. That and I was trying out this code formatter I found (http://www.manoli.net/csharpformat/) for when I start posting code.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview