Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }