Skip to content

$appusers->impersonate()

Become any existing user or disable the current user

$appusers->impersonate(string $who = null, Closure $callback = null): mixed

Parameters

Name Type Default Description
$who string null User ID or email address,
null to use the actual user again,
'kirby' for a virtual admin user or
'nobody' to disable the actual user
$callback Closure null Optional action function that will be run with
the permissions of the impersonated user; the
impersonation will be reset afterwards

Return type

mixed

Exceptions

Type Description
Throwable

Parent class

Kirby\Cms\AppUsers