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

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

export function userHasLocationsCatalogAction(user: User | null, action: LocationsCatalogAction): boolean {
	return userHasPermission(user, `cat_locations.${action}`);
}
