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

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

export function userHasExchangeRatesAction(user: User | null, action: ExchangeRatesCatalogAction): boolean {
	return userHasPermission(user, `cat_exchange_rates.${action}`);
}
