import type { MomentumConfig, CollectionConfig, UserContext } from '@momentumcms/core'; /** * Result of checking admin access for a single collection. */ export interface CollectionAccess { slug: string; canAccess: boolean; } /** * Full access permissions for a collection. */ export interface CollectionPermissions { slug: string; canAccess: boolean; canCreate: boolean; canRead: boolean; canUpdate: boolean; canDelete: boolean; /** True if this collection is managed (read-only via API, owned by a plugin like Better Auth). */ managed?: boolean; } /** * Response shape for the /access endpoint. */ export interface AccessResponse { collections: CollectionPermissions[]; } /** * Checks if a user has admin panel access to a specific collection. * * @param collection - The collection config to check * @param user - The current user context (undefined if not authenticated) * @returns true if access is allowed, false otherwise */ export declare function checkSingleCollectionAdminAccess(collection: CollectionConfig, user: UserContext | undefined): Promise; /** * Checks admin access for all collections in a configuration. * Returns which collections the user can access in the admin panel. * * @param config - The Momentum CMS configuration * @param user - The current user context (undefined if not authenticated) * @returns Array of collection slugs with their access status */ export declare function checkCollectionAdminAccess(config: MomentumConfig, user: UserContext | undefined): Promise; /** * Gets full permissions for all collections. * Used by the /access endpoint to inform the frontend about what * operations the user can perform. * * @param config - The Momentum CMS configuration * @param user - The current user context (undefined if not authenticated) * @returns Full permissions for each collection */ export declare function getCollectionPermissions(config: MomentumConfig, user: UserContext | undefined): Promise; /** * Warns about collections that rely on insecure default access. * Returns the warning messages (useful for testing). */ export declare function warnInsecureDefaults(collections: CollectionConfig[]): string[];