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

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

export function userHasEquivalenciesAction(user: User | null, action: EquivalenciesCatalogAction): boolean {
	return userHasPermission(user, `cat_equivalencies.${action}`);
}
