Package com.sm.web.rbac.pojo

Examples of com.sm.web.rbac.pojo.Account


  @Override
  protected AuthorizationInfo doGetAuthorizationInfo(
      PrincipalCollection principalCollection) {
    String accountName = (String) principalCollection.fromRealm(getName())
        .iterator().next();
    Account account = accountService.getFullAccount(accountName);
    if (account != null) {
      SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
      for (Role role : account.getRoleList()) {
        authorizationInfo.addRole(role.getName());
        authorizationInfo.addStringPermissions(role
            .getOperationTitleList());
      }
      return authorizationInfo;
View Full Code Here


      throws AuthenticationException {
    UsernamePasswordToken passwordToken = (UsernamePasswordToken) authenticationToken;
    String accoutNo= passwordToken.getUsername();
    if(null!=accoutNo&&!"".equals(accoutNo))
    {
      Account account=accountService.login(accoutNo, String.valueOf(passwordToken.getPassword()));
      if(account!=null)
      {
        return new SimpleAuthenticationInfo(account.getAccount(),account.getPassword(),getName());
      }
    }
    return null;
  }
View Full Code Here

   * @param
   * @param
   * @return Account ����10:50:17 ��С��
   **/
  public Account getFullAccount(String accountNo) {
    Account account = accountModel.findByProperty("account", accountNo);
    if (null != account) {
      // ��ȡ�˺ŵ����е�Id
      List<Integer> roleIdList = accountRoleModel.queryRoleIdList(account
          .getId());
      if (null != roleIdList && roleIdList.size() > 0) {
        // ���ý�ɫId
        account.setRoleIdList(roleIdList);
        List<Role> roleList = roleModel.queryInIds(StringUtil
            .combIntString(roleIdList));
        for (Role role : roleList) {
          Integer roleId = role.getId();
          List<Integer> operationIdList = roleOperationModel
              .queryOperationIdList(roleId);
          List<Operation> operationList = operationModel
              .queryInIds(StringUtil
                  .combIntString(operationIdList));
          role.setOperationList(operationList);
          role.setOperationIdList(roleIdList);
        }
        account.setRoleList(roleList);
      }
    }
    return account;
  }
View Full Code Here

TOP

Related Classes of com.sm.web.rbac.pojo.Account

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.