@Override
		protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
          
		    logger.info("User Login to initialize authorized.....");
		  
			ShiroUser shiroUser = (ShiroUser) principals.getPrimaryPrincipal();
			//1)获取用户信息的所有资料，如权限角色等.
			User user = userService.findUser(shiroUser.loginName);
			
			if (user != null) {
				  SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
				  //2)info.setRoles(角色集合);
				  List<Role> roleLists = roleService.selectList(user.getId());
				  for(Role role: roleLists){
                      info.addRole(role.getRoleName());
                      
					  //3)info.setStringPermissions(权限集合);
					  List<Permission>   permissionLists =  permissionService.selectList(role.getId());
					  for(Permission permission: permissionLists){
						  info.addStringPermission(permission.getPermissionName());
					  }
				  }
				  logger.info("User [" + user.getUserName()+ "] logged in successfully.");
				  return info;
		  }else{
			  logger.info("User [" + user.getUserName()+ "] logged in fail.!");
			  return null;
		  }
	  }