In BonsaiDb, nearly everything has a resource name. The example above refers to a document with ID
1 in the
khonsulabs-admin.users collection in any database. The
bonsaidb::core::permissions::bonsai module contains functions to create properly formatted
Also within the same module are the built-in
Actions. The base enum for all actions used within BonsaiDb is
BonsaiAction Below is an overview of the resource names and actions by category.
ServerAction enum contains the actions that are related to
StorageConnection. For APIs that accept a database name parameter, the resource name will be
database_resource_name(database). For all other actions, the resource name is
For actions that operate upon users (e.g., creating a user), the resource name is user_resource_name(username).
Access to encrypted information can be controlled by limiting access to the encryption key used. Currently, BonsaiDb only has support for a shared master key, but in the future additional keys will be able to be created. Because
Decrypt are separate actions, access to read and write can be controlled independently.
The resource name for an encryption key is
Collections, there are three resource names used. For actions that operate on the collection directly, the resource name is
collection_resource_name(database, collection). For actions that operate on a document, the resource name is
document_resource_name(database, collection, id). Finally, for actions that operate on a
View, the resource name is
For actions that operate upon the key-value entry, the resource name is
keyvalue_key_resource_name(database, namespace, key).
For actions that operate on a
PubSub topic, the resource name is