Package com.github.dactiv.showcase.common

Examples of com.github.dactiv.showcase.common.SessionVariable


   *
   */
  protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
       
        SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
        SessionVariable model = principals.oneByType(SessionVariable.class);
       
        Assert.notNull(model, "找不到principals中的SessionVariable");
       
        String id = model.getUser().getId();
       
        //加载用户资源信息
        List<Resource> authorizationInfo = accountManager.getUserResources(id);
        List<Resource> resourcesList = accountManager.mergeResourcesToParent(authorizationInfo, ResourceType.Security);
       
        model.setAuthorizationInfo(authorizationInfo);
        model.setMenusList(resourcesList);
       
        //添加用户拥有的permission
        addPermissions(info,authorizationInfo);
       
        return info;
View Full Code Here


        sb.append("<hr>");
      }
    }
   
    //获取当前SessionVariable,通过该变量获取当前用户
    SessionVariable sessionVariable = SystemVariableUtils.getSessionVariable();
    //如果SessionVariable等于null,表示用户未登录,但一样要记录操作
    if (sessionVariable != null) {
      record.setFkUserId(sessionVariable.getUser().getId());
      record.setUsername(sessionVariable.getUser().getUsername());
    }
   
    String function = audit.function();
    String module = "";
   
View Full Code Here

       
        if (user.getState().equals(State.Disable.getValue())) {
           throw new DisabledAccountException("你的账户已被禁用,请联系管理员开通.");
        }
       
        SessionVariable model = new SessionVariable(user);
       
        return new SimpleAuthenticationInfo(model,user.getPassword(),getName());
  }
View Full Code Here

TOP

Related Classes of com.github.dactiv.showcase.common.SessionVariable

Copyright © 2018 www.massapicom. 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.