added /dist

This commit is contained in:
2026-08-03 12:24:28 +02:00
parent dd97bb67fe
commit 05150e7ece
490 changed files with 6667 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import type { Role } from './types.js';
/**
* The plugin can't know the client's generated User type, and Payload types
* `req.user` loosely (UntypedUser | null). Predicates therefore accept an
* unknown-ish user and read `roles` defensively — no assumptions about shape
* beyond an optional roles array.
*/
type MaybeUser = {
roles?: null | Role[];
} | null | Record<string, unknown> | undefined;
/**
* True if the user holds at least the given role in the hierarchy.
* admin satisfies 'editor' and 'user'; editor satisfies 'user'.
*/
export declare function hasMinimumRole(user: MaybeUser, minimum: Role): boolean;
/** True if the user is an admin. */
export declare function isAdmin(user: MaybeUser): boolean;
/** True if the user is an editor or higher (editor, admin). */
export declare function isEditor(user: MaybeUser): boolean;
export {};