new_user

Creates a new user to ThingsDB. The new user is created without a password, token and access privileges. You probably want to set a password or add a new token, and assign some privileges using grant(…).

This function requires GRANT privileges on the @thingsdb scope.

This function generates a change.

Function

new_user(user)

Arguments

Argument Type Description
user str (required) Username, between 1 and 128 graphical characters.

Return value

Returns the new user name if successful. A lookup_err() is raised if the user already exists.

Example

Create a new user iris:

new_user('iris');

Return value in JSON format (the new user name)

"iris"