10 lines
387 B
TypeScript
10 lines
387 B
TypeScript
import type { Field } from 'payload';
|
|
import type { Role } from './types.js';
|
|
/**
|
|
* Builds the fixed `roles` field the plugin injects into the auth collection.
|
|
*
|
|
* Saved to the JWT so role checks avoid a database lookup. Only admins can
|
|
* change roles, preventing privilege escalation by lower-privilege users.
|
|
*/
|
|
export declare function buildRolesField(defaultRole?: Role): Field;
|