Skip to main content

Function: setViewAs()

setViewAs(formData): Promise<void>

Defined in: src/server/actions/impersonation.ts:46

Owner-only: set or clear the "View as" lens. target is 'self' (stop), 'role:<key>' / 'role:' (a staff access-role, blank = unassigned staff), or 'contractor:<id>'. Validates the target against the company, writes an audit row, and redirects to the relevant surface. Read-only: it changes what the owner SEES, never their identity for writes.

Parameters

formData

FormData

Returns

Promise<void>