示例#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);
        }
示例#2
0
文件: Secure.cs 项目: gkovalev/nastia
        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);
        }