private boolean validateCreateUser(User user,HttpServletResponse response) throws WebMessageException {
  if (!aclService.canCreate(currentUserService.getCurrentUser(),getEntityClass())) {
    throw new CreateAccessDeniedException("You don't have the proper permissions to create this object.");
  }
  if (!userService.canAddOrUpdateUser(IdentifiableObjectUtils.getUids(user.getGroups()))) {
    throw new WebMessageException(WebMessageUtils.conflict("You must have permissions to create user, or ability to manage at least one user group for the user."));
  }
  List<String> uids=IdentifiableObjectUtils.getUids(user.getGroups());
  for (  String uid : uids) {
    if (!userGroupService.canAddOrRemoveMember(uid)) {
      throw new WebMessageException(WebMessageUtils.conflict("You don't have permissions to add user to user group: " + uid));
    }
  }
  return true;
}

private boolean validateCreateUser ( User user , HttpServletResponse response ) throws WebMessageException { if ( ! aclService . canCreate ( currentUserService . getCurrentUser ( ) , getEntityClass ( ) ) ) { throw new CreateAccessDeniedException ( "You don't have the proper permissions to create this object." ) ; } if ( ! userService . canAddOrUpdateUser ( IdentifiableObjectUtils . getUids ( user . getGroups ( ) ) ) ) { throw new WebMessageException ( WebMessageUtils . conflict ( "You must have permissions to create user, or ability to manage at least one user group for the user." ) ) ; } List < String > uids = IdentifiableObjectUtils . getUids ( user . getGroups ( ) ) ; for ( String uid : uids ) { if ( ! userGroupService . canAddOrRemoveMember ( uid ) ) { throw new WebMessageException ( WebMessageUtils . conflict ( "You don't have permissions to add user to user group: " + uid ) ) ; } } return true ; }
validates whether the given user can be created .
