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

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

export function userHasPackagesAction(user: User | null, action: PackagesCatalogAction): boolean {
	return userHasPermission(user, `cat_packages.${action}`);
}
