ArangoDB-PHP API Documentation
  • Namespace
  • Class
  • Deprecated

Namespaces

  • triagens
    • ArangoDb

Classes

  • AdminHandler
  • AqlUserFunction
  • Autoloader
  • Batch
  • BatchPart
  • BindVars
  • Collection
  • CollectionHandler
  • Connection
  • ConnectionOptions
  • Cursor
  • Database
  • DefaultValues
  • Document
  • DocumentHandler
  • Edge
  • EdgeDefinition
  • EdgeHandler
  • Endpoint
  • Export
  • ExportCursor
  • Graph
  • GraphHandler
  • Handler
  • HttpHelper
  • HttpResponse
  • QueryCacheHandler
  • QueryHandler
  • Statement
  • TraceRequest
  • TraceResponse
  • Transaction
  • Traversal
  • UpdatePolicy
  • UrlHelper
  • Urls
  • User
  • UserHandler
  • ValueValidator
  • Vertex
  • VertexHandler

Exceptions

  • ClientException
  • ConnectException
  • Exception
  • ServerException

Class UserHandler

A handler that manages users . A user-document handler that fetches vertices from the server and persists them on the server. It does so by issuing the appropriate HTTP requests to the server.

triagens\ArangoDb\Handler
Extended by triagens\ArangoDb\UserHandler
Namespace: triagens\ArangoDb
Package: triagens\ArangoDb
Since: 1.2
Located at UserHandler.php

Methods summary

public boolean
# addUser( string $username, mixed $passwd = null, mixed $active = null, array $extra = null )

save a user to the user-collection

save a user to the user-collection

This will save the user to the users collection. It will additionally grant the user permissions for the current database

This will throw if the user cannot be saved

Parameters

$username
  • The name of the user as a string. This is mandatory.
$passwd
  • The user password as a string. If no password is specified, the empty string will be used.
$active
  • an optional flag that specifies whether the user is active. If not specified, this will default to true.
$extra
  • an optional array with arbitrary extra data about the user.

Returns

boolean
  • true, if user could be saved

Throws

triagens\ArangoDb\Exception

Since

1.2
public boolean
# replaceUser( string $username, mixed $passwd = null, mixed $active = null, array $extra = null )

Replace an existing user, identified by its username

Replace an existing user, identified by its username

This will replace the user-document on the server

This will throw if the document cannot be replaced

Parameters

$username
  • The name of the user as a string, who's user-data is going to be replaced. This is mandatory.
$passwd
  • The user password as a string. If no password is specified, the empty string will be used.
$active
  • an optional flag that specifies whether the user is active. If not specified, this will default to true.
$extra
  • an optional array with arbitrary extra data about the user.

Returns

boolean
  • always true, will throw if there is an error

Throws

triagens\ArangoDb\Exception
public boolean
# updateUser( string $username, mixed $passwd = null, mixed $active = null, array $extra = null )

Update an existing user, identified by the username

Update an existing user, identified by the username

This will update the user-document on the server

This will throw if the document cannot be updated

Parameters

$username
  • The name of the user as a string, who's user-data is going to be updated. This is mandatory.
$passwd
  • The user password as a string. If no password is specified, the empty string will be used.
$active
  • an optional flag that specifies whether the user is active. If not specified, this will default to true.
$extra
  • an optional array with arbitrary extra data about the user.

Returns

boolean
  • always true, will throw if there is an error

Throws

triagens\ArangoDb\Exception
public triagens\ArangoDb\User
# get( string $username )

Get a single user-document, identified by the username

Get a single user-document, identified by the username

This will throw if the document cannot be fetched from the server

Parameters

$username
  • username as a string

Returns

triagens\ArangoDb\User
  • the user-document fetched from the server

Throws

triagens\ArangoDb\Exception
public boolean
# removeUser( string $username )

Remove a user, identified by the username

Remove a user, identified by the username

Parameters

$username
  • username as a string, of the user that is to be deleted

Returns

boolean
  • always true, will throw if there is an error

Throws

triagens\ArangoDb\Exception
public boolean
# grantPermissions( string $username, string $databaseName )

Grant R/W permissions to a user, for a specific database

Grant R/W permissions to a user, for a specific database

Parameters

$username
  • username as a string
$databaseName
  • name of database as a string

Returns

boolean
  • always true, will throw if there is an error

Throws

triagens\ArangoDb\Exception
public boolean
# revokePermissions( string $username, string $databaseName )

Revoke R/W permissions for a user, for a specific database

Revoke R/W permissions for a user, for a specific database

Parameters

$username
  • username as a string
$databaseName
  • name of database as a string

Returns

boolean
  • always true, will throw if there is an error

Throws

triagens\ArangoDb\Exception
public array
# getDatabases( string $username )

Gets the list of databases a user has access to

Gets the list of databases a user has access to

Parameters

$username
  • username as a string

Returns

array
of database names for the databases the user has access to

Throws

triagens\ArangoDb\Exception

Methods inherited from triagens\ArangoDb\Handler

__construct(), getConnection(), getConnectionOption(), includeOptionsInBody(), includeOptionsInParams(), json_encode_wrapper(), makeCollection()

ArangoDB-PHP API Documentation API documentation generated by ApiGen