Ejemplo n.º 1
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var user = AuthFormService.GetCurrentUser();

            if ((user == null) || !user.IsSuper)
            {
                filterContext.Result = new RedirectResult("~/Admin/Account/Login");
            }
            base.OnActionExecuting(filterContext);
        }
Ejemplo n.º 2
0
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     if (!filterContext.ActionDescriptor.IsDefined(typeof(NoPermissionRequiredAttribute), true))
     {
         var user = AuthFormService.GetCurrentUser();
         if (user == null)
         {
             filterContext.Result = new RedirectResult("~/Admin/Account/Login");
         }
     }
     base.OnActionExecuting(filterContext);
 }