userDetails.userId = user.getId();
userDetails.salt = user.getSalt();
userDetails.password = user.getPassword();
userDetails.username = user.getUsername();
userDetails.enabled = user.getStatus()==1;
UserGroup userGroup = userService.getSystemUserGroupById(user.getUserGroupId());
if(userGroup!=null){
userDetails.authorities.add(userGroup.getName());
String permString = userGroup.getPermission();
userDetails.permissions = UserPermissions.unserializePermissions(permString);
}
logger.debug("Found user username={}, enabled={}", username, userDetails.enabled);