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

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

export function userHasUmGeneralAction(user: User | null, action: UmGeneralCatalogAction): boolean {
	return userHasPermission(user, `cat_um_general.${action}`);
}
