示例#1
0
        public ActionResult Index()
        {
            AccessControl ac     = new AccessControl();
            string        result = ac.HasAccess("administrator, user");

            if (result == "-1")
            {
                ModelState.AddModelError("error", TestCorrection.Resources.Resources.SessionExpired);
                return(RedirectToAction("Index", "Login"));
            }
            else if (result == "-2")
            {
                ModelState.AddModelError("error", TestCorrection.Resources.Resources.NoAccess);
                return(RedirectToAction("Index", "Login"));
            }

            return(View());
        }