/**
 * Datos de referencia — permisos `ref_material_types.*` (seed_v2.py `permissions_reference`).
 * Solo lectura en seed actual; `action` reservado por si se amplía el CRUD.
 * Tipos de material
 */
import type { User } from '$lib/auth';
import { userHasPermission } from '$lib/auth';

export type MaterialTypesRefAction = 'view';

export function userHasMaterialTypesRefAction(user: User | null, action: MaterialTypesRefAction): boolean {
	return userHasPermission(user, `ref_material_types.${action}`);
}
