public static bool VerifyAccessLevel() { if (Trial.TrialService.IsTrialEnabled) { return(true); } bool allow; switch (CustomerContext.CurrentCustomer.CustomerRole) { case Role.Administrator: allow = true; break; case Role.Moderator: allow = RoleAccess.Check(CustomerContext.CurrentCustomer, HttpContext.Current.Request.Url.ToString().ToLower()); break; default: allow = false; break; } if (!allow) { HttpContext.Current.Response.Redirect("~/AccessDenied.aspx"); } return(allow); }
public static bool VerifyAccessLevel() { bool allow = false; switch (CustomerSession.CurrentCustomer.CustomerRole) { case Role.Administrator: allow = true; break; case Role.Moderator: allow = RoleAccess.Check(CustomerSession.CurrentCustomer, HttpContext.Current.Request.Url.ToString().ToLower()); break; } if (!allow) { HttpContext.Current.Response.Redirect("~/AccessDenied.aspx"); } return(allow); }