protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            string controllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName;
            string actionName     = filterContext.ActionDescriptor.ActionName;
            bool   b = MembershipEx.CanDo(User.Identity.Name, controllerName, actionName);

            if (!b)
            {
                filterContext.HttpContext.Response.Write("没有访问权限");
                filterContext.HttpContext.Response.End();
            }
            base.OnActionExecuting(filterContext);
        }
Beispiel #2
0
 public void Test()
 {
     MembershipEx.CanDo("jerry", "Test", "AAA");
 }