[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/admin](../../README) / [index](../README) / impersonateAction

# Function: impersonateAction()

> **impersonateAction**(): [`Action`](../classes/Action)

Defined in: [admin/src/actions/Action.ts:434](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/actions/Action.ts#L434)

Act as this user, and get a way back.

Gated twice: the resource must opt in with `static impersonatable = true`,
*and* its `can("impersonate", record)` must allow this record. `can()` alone
defaults to allow, which is the wrong default for becoming another user, so
the opt-in carries the refusal.

## Returns

[`Action`](../classes/Action)
