Oihana PHP Arango

currentUser.php

Table of Contents

Functions

currentUser()  : string
Return the name of the current user.

Functions

currentUser()

Return the name of the current user.

currentUser() : string

TThe current user is the user account name that was specified in the Authorization HTTP header of the request. It will only be populated if authentication on the server is turned on, and if the query was executed inside a request context. Otherwise, the return value of this function will be null.

Returns userName (string|null): the current user name, or null if authentication is disabled

This helper wraps the ArangoDB AQL function CURRENT_USER().

Example AQL output:

CURRENT_USER()
Tags
example
use function oihana\arango\db\functions\currentUser;

$expr = currentUser();
// Produces: 'CURRENT_USER()'
see
https://docs.arangodb.com/stable/aql/functions/miscellaneous/#current_user
since
1.0.0

author Marc Alcaraz

Return values
string

The formatted AQL expression (e.g. 'CURRENT_USER()').

On this page

Search results