ArangoDB's Users operations.
Every function takes the pool as its first argument and returns the decoded
response body. See Arangox.API.Client for the options they all accept and
for what a 404 returns.
Summary
Functions
List available users
List available users. Raises on error.
List a user’s accessible databases
List a user’s accessible databases. Raises on error.
Get a user’s collection access level
Get a user’s collection access level. Raises on error.
Create a user
Create a user. Raises on error.
Get a user’s database access level
Get a user’s database access level. Raises on error.
Remove a user
Remove a user. Raises on error.
Clear a user’s collection access level
Clear a user’s collection access level. Raises on error.
Clear a user’s database access level
Clear a user’s database access level. Raises on error.
Get a user
Get a user. Raises on error.
Replace a user
Replace a user. Raises on error.
Set a user’s collection access level
Set a user’s collection access level. Raises on error.
Set a user’s database access level
Set a user’s database access level. Raises on error.
Update a user
Update a user. Raises on error.
Functions
@spec all( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
List available users
Fetches data about all users. You need the Administrate server access level in order to execute this REST call. Otherwise, you will only get information about yourself.
The call will return a JSON object with at least the following attributes on success:
user: The name of the user as a string.active: Whether the user account is able to log in to the database system.extra: A JSON object with extra user information. It is used by the web interface to store graph viewer settings and saved queries.
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => [%{
"active" => boolean,
"extra" => %{},
"user" => string
}]
}
@spec all!( Arangox.conn(), keyword() ) :: term()
List available users. Raises on error.
See all/1.
@spec all_databases(Arangox.conn(), binary(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
List a user’s accessible databases
Fetch the list of databases available to the specified user.
You need Administrate permissions for the server access level in order to execute this REST call.
The call will return a JSON object with the per-database access
privileges for the specified user. The result object will contain
the databases names as object keys, and the associated privileges
for the database as values.
In case you specified full, the result will contain the permissions
for the databases as well as the permissions for the collections.
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => %{}
}
@spec all_databases!(Arangox.conn(), binary(), keyword()) :: term()
List a user’s accessible databases. Raises on error.
See all_databases/2.
@spec collection_permissions(Arangox.conn(), binary(), binary(), binary(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Get a user’s collection access level
Returns the collection access level for a specific collection
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => string
}
Get a user’s collection access level. Raises on error.
@spec create(Arangox.conn(), term(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Create a user
Create a new user. You need server access level Administrate in order to execute this REST call.
@spec create!(Arangox.conn(), term(), keyword()) :: term()
Create a user. Raises on error.
See create/2.
@spec database_permissions(Arangox.conn(), binary(), binary(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Get a user’s database access level
Fetch the database access level for a specific database
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => string
}
@spec database_permissions!(Arangox.conn(), binary(), binary(), keyword()) :: term()
Get a user’s database access level. Raises on error.
@spec delete(Arangox.conn(), binary(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Remove a user
Removes an existing user, identified by user.
You need Administrate permissions for the server access level in order to execute this REST call.
@spec delete!(Arangox.conn(), binary(), keyword()) :: term()
Remove a user. Raises on error.
See delete/2.
@spec delete_collection_permissions( Arangox.conn(), binary(), binary(), binary(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Clear a user’s collection access level
Clears the collection access level for the collection collection in the
database dbname of user user. As consequence, the default collection
access level is used. If there is no defined default collection access level,
it defaults to No access.
You need write permissions (Administrate access level) for the _system
database in order to execute this REST call.
@spec delete_collection_permissions!( Arangox.conn(), binary(), binary(), binary(), keyword() ) :: term()
Clear a user’s collection access level. Raises on error.
@spec delete_database_permissions(Arangox.conn(), binary(), binary(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Clear a user’s database access level
Clears the database access level for the database dbname of user user. As
consequence, the default database access level is used. If there is no defined
default database access level, it defaults to No access.
You need write permissions (Administrate access level) for the _system
database in order to execute this REST call.
@spec delete_database_permissions!(Arangox.conn(), binary(), binary(), keyword()) :: term()
Clear a user’s database access level. Raises on error.
@spec get(Arangox.conn(), binary(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Get a user
Fetches data about the specified user. You can fetch information about yourself or you need the Administrate server access level in order to execute this REST call.
Returns
Recorded against ArangoDB 3.12.10:
%{
"active" => boolean,
"code" => integer,
"error" => boolean,
"extra" => %{},
"user" => string
}
@spec get!(Arangox.conn(), binary(), keyword()) :: term()
Get a user. Raises on error.
See get/2.
@spec replace(Arangox.conn(), binary(), term(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Replace a user
Replaces the data of an existing user. This resets the user's access levels for databases and collections. You need server access level Administrate in order to execute this REST call. Additionally, users can change their own data.
@spec replace!(Arangox.conn(), binary(), term(), keyword()) :: term()
Replace a user. Raises on error.
See replace/3.
@spec set_collection_permissions( Arangox.conn(), binary(), binary(), binary(), term(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Set a user’s collection access level
Sets the collection access level for the collection in the database dbname
for user user. You need the Administrate server access level in order to
execute this REST call.
@spec set_collection_permissions!( Arangox.conn(), binary(), binary(), binary(), term(), keyword() ) :: term()
Set a user’s collection access level. Raises on error.
@spec set_database_permissions(Arangox.conn(), binary(), binary(), term(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Set a user’s database access level
Sets the database access levels for the database dbname of user user. You
need the Administrate server access level in order to execute this REST
call.
Set a user’s database access level. Raises on error.
@spec update(Arangox.conn(), binary(), term(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Update a user
Partially modifies the data of an existing user. You need server access level Administrate in order to execute this REST call. Additionally, users can change their own data.
@spec update!(Arangox.conn(), binary(), term(), keyword()) :: term()
Update a user. Raises on error.
See update/3.