User
Less than 1 minute
User
interface UserMethods
listUsers
List all users in the database.
public listUsers(): arrayReturns: array
createUser
Create a new user in the database.
public createUser(string $name, ?string $password, array $privileges): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$password | string | |
$privileges | array |
dropUser
Drop a user from the database.
public dropUser(string $name, bool $ifExists): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$ifExists | bool |
grant
Change the password for a user.
public grant(array|string $role, string $to, string $on, ?string $onType): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$role | array | string |
$to | string | |
$on | string | |
$onType | string |
revoke
Revoke a role from a user.
public revoke(array|string $role, string $from, string $on, ?string $onType): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$role | array | string |
$from | string | |
$on | string | |
$onType | string |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000