'POST /api/users
Creates a new Galaxy user.'

@expose_api
def create(self, trans, payload, **kwd):

    if ((not trans.app.config.allow_user_creation) and (not trans.user_is_admin())):
        raise exceptions.ConfigDoesNotAllowException('User    creation    is    not    allowed    in    this    Galaxy    instance')
    if (trans.app.config.use_remote_user and trans.user_is_admin()):
        user = trans.get_or_create_remote_user(remote_user_email=payload['remote_user_email'])
    elif trans.user_is_admin():
        username = payload['username']
        email = payload['email']
        password = payload['password']
        message = '\n'.join([validate_email(trans, email), validate_password(trans, password, password), validate_publicname(trans, username)]).rstrip()
        if message:
            raise exceptions.RequestParameterInvalidException(message)
        else:
            user = self.create_user(trans=trans, email=email, username=username, password=password)
    else:
        raise exceptions.NotImplemented()
    item = user.to_dict(view='element', value_mapper={'id': trans.security.encode_id, 'total_disk_usage': float})
    return item
