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

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

export function userHasLegendsAction(user: User | null, action: LegendsCatalogAction): boolean {
	return userHasPermission(user, `cat_legends.${action}`);
}
