trusted_metadata on the User object to store role information and enforce authorization in your application. For new integrations, use native RBAC policies instead.
This guide is provided for backward compatibility. Native RBAC provides a dedicated policy model, Dashboard management, and SDK support.
Define your roles and permissions
Decide on the roles your application needs (for example
admin, editor, viewer) and what actions each role should allow.Store roles in trusted metadata
Use
trusted_metadata to store roles when creating or updating a User. Only your backend can write trusted metadata.Read roles during authentication
After authenticating a session, fetch the User and read roles from
trusted_metadata.