diff --git a/inventory-backend/app/api/v1/inbound/product.py b/inventory-backend/app/api/v1/inbound/product.py index 52a9df8..b299aa0 100644 --- a/inventory-backend/app/api/v1/inbound/product.py +++ b/inventory-backend/app/api/v1/inbound/product.py @@ -129,10 +129,8 @@ def submit(): perm_code = field_to_perm.get(field) if perm_code and perm_code not in user_permissions: data.pop(field, None) new_stock = ProductInboundService.handle_inbound(data) - # ★ Fail-Closed: 入库成功响应剥离成本/售价字段 - resp = new_stock.to_dict() - for k in ('raw_material_cost', 'manual_cost', 'unit_total_cost', 'sale_price'): - resp.pop(k, None) + from app.utils.field_permissions import apply_strict_rbac + resp = apply_strict_rbac(new_stock.to_dict(), 'StockProduct', user_permissions) return jsonify({"code": 200, "msg": "入库成功", "data": resp}) except Exception as e: traceback.print_exc() diff --git a/inventory-backend/app/api/v1/inbound/semi.py b/inventory-backend/app/api/v1/inbound/semi.py index 79520b0..810bbbf 100644 --- a/inventory-backend/app/api/v1/inbound/semi.py +++ b/inventory-backend/app/api/v1/inbound/semi.py @@ -123,10 +123,8 @@ def submit(): if field in data and perm_code not in user_permissions: data.pop(field, None) new_stock = SemiInboundService.handle_inbound(data) - # ★ Fail-Closed: 入库成功响应剥离成本字段 - resp = new_stock.to_dict() - for k in ('raw_material_cost', 'manual_cost', 'unit_total_cost', 'total_price'): - resp.pop(k, None) + from app.utils.field_permissions import apply_strict_rbac + resp = apply_strict_rbac(new_stock.to_dict(), 'StockSemi', user_permissions) return jsonify({"code": 200, "msg": "入库成功", "data": resp}) except Exception as e: traceback.print_exc()