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

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

export function userHasSectorsCatalogAction(user: User | null, action: SectorsCatalogAction): boolean {
	return userHasPermission(user, `cat_sectors.${action}`);
}
