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

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

export function userHasErrorCatalogsAction(user: User | null, action: ErrorCatalogsCatalogAction): boolean {
	return userHasPermission(user, `cat_errors.${action}`);
}
