/**
 * Catálogo general — permisos `cat_prevalidators.*` (`permissions_general` en seed_v2.py).
 * Prevalidadores
 */
import type { User } from '$lib/auth';
import { userHasPermission } from '$lib/auth';

export type PrevalidatorsCatalogAction = 'view' | 'create' | 'edit' | 'delete';

export function userHasPrevalidatorsAction(user: User | null, action: PrevalidatorsCatalogAction): boolean {
	return userHasPermission(user, `cat_prevalidators.${action}`);
}
