Examples of ViewWrapper


Examples of org.nutz.mvc.view.ViewWrapper

    Auth auth = method.getAnnotation(Auth.class);
    if (auth == null) //没有@Auth,恩,无需过滤
      return null; //返回null,就是继续下一个ActionFilter
    User me = (User) actionContext.getRequest().getSession().getAttribute("me");
    if (me == null)
      return new ViewWrapper(new AjaxView(), Ajax.fail().setData("Not login yet!"));
    if ("anonymous".equals(me.getProvider())) //默认用户? 啥授权都不允许
      return new ViewWrapper(new AjaxView(), Ajax.fail().setData("anonymous can't do this!"));
    if ("root".equals(me.getProvider())) {
      if (log.isInfoEnabled())
        log.info("Access as root , pass");
      return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.