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

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

export function userHasPortsAction(user: User | null, action: PortsCatalogAction): boolean {
	return userHasPermission(user, `cat_ports.${action}`);
}
