Restrict access with the current_user object
Use the current_user object to filter query results, control component visibility, and implement row-level security in Retool apps.
The current_user object is a global available in every Retool app that contains data about the currently signed-in user. You can reference it in queries, component properties, and JavaScript to filter data, restrict UI access, and implement row-level security.
Available properties
| Property | Type | Description |
|---|---|---|
current_user.id | number | Unique user ID within your Retool organization. |
current_user.email | string | User's email address. Unique per organization. |
current_user.firstName | string | null | User's first name. |
current_user.lastName | string | null | User's last name. |
current_user.fullName | string | Computed full name. |
current_user.profilePhotoUrl | string | null | URL of the user's profile photo. |
current_user.groups | Array<{ id: number; name: string }> | Groups the user belongs to. |
current_user.metadata | Record<string, unknown> | Custom attributes set by an admin. See User metadata. |
current_user.locale | string | User's locale preference (e.g., en). |
current_user.externalIdentifier | string | null | Identifier for external users in Retool Embed. |
For the full object reference, see current_user.
Filter query results by user
The most common use of current_user is filtering database queries so users only see records they're authorized to access.