You can use the schema manager to perform CRUD actions on database users.
The schema manager supports the following index functions:
Get user properties.
$arangoClient->schema()->getUser('kimiko');
Get user properties of all visible users.
$arangoClient->schema()->getUsers();
Check if a user exists.
$arangoClient->schema()->hasUser('kimiko');
Create a user.
$arangoClient->schema()->createUser([
'user' => 'kimiko',
'password' => 'highly secretive password'
]);
Update a user's properties
$arangoClient->schema()->updateUser([
'user' => 'kimiko',
['active => false]
]);
Replace a user. Used to change the username.
$arangoClient->schema()->replaceUser([
'user' => 'kimiko',
[
'user' => 'newUserName',
'active' => true
]
]);
Delete a user.
$arangoClient->schema()->deleteUser('newUserName');
Get the access level a user has on a specific database.
$this->schemaManager->getDatabaseAccessLevel('root', '_system');
Set the access level a user has for a specific database.
$this->schemaManager->getDatabaseAccessLevel('kimiko', 'the_boys', 'rw');
Remove the access level of a user for a specific database.
$this->schemaManager->clearDatabaseAccessLevel('kimiko', 'the_boys');