From ea1c5a7835db7d4c56c029fe6064465791a07b06 Mon Sep 17 00:00:00 2001 From: wsb1224 Date: Mon, 6 Jul 2026 14:31:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20salesman=E8=A7=92=E8=89=B2=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0order:update=E6=9D=83=E9=99=90=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=BF=AE=E6=94=B9=E7=89=A9=E6=B5=81=E5=8D=95=E5=8F=B7?= =?UTF-8?q?403=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 业务员修改物流单号时PUT /api/orders/{id}/tracking返回403, 根因是salesman角色缺少order:update权限码。在DEFAULT_ROLE_PERMISSIONS、 DEFAULT_ROLE_MENU_CODES和DEFAULT_MENUS三处同步补全。 Co-Authored-By: Claude Sonnet 4.6 --- backend/app/services/auth_service.py | 1 + backend/app/services/bootstrap.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/backend/app/services/auth_service.py b/backend/app/services/auth_service.py index ec56488..044c2ab 100644 --- a/backend/app/services/auth_service.py +++ b/backend/app/services/auth_service.py @@ -77,6 +77,7 @@ class AuthService: "order:list", "order:create", "order:submit", + "order:update", "customer:list", "reminder:list", "ai:parse-order", diff --git a/backend/app/services/bootstrap.py b/backend/app/services/bootstrap.py index 5208726..870b123 100644 --- a/backend/app/services/bootstrap.py +++ b/backend/app/services/bootstrap.py @@ -104,6 +104,7 @@ DEFAULT_MENUS = [ # 按钮权限 - 订单相关 {"id": 20, "parent_id": 5, "menu_name": "提交审核", "menu_path": "", "menu_type": "button", "permission_code": "order:submit", "icon": "", "sort_no": 20, "status": 1}, {"id": 21, "parent_id": 5, "menu_name": "取消审批", "menu_path": "", "menu_type": "button", "permission_code": "order:cancel-approve", "icon": "", "sort_no": 21, "status": 1}, + {"id": 24, "parent_id": 5, "menu_name": "订单更新", "menu_path": "", "menu_type": "button", "permission_code": "order:update", "icon": "", "sort_no": 24, "status": 1}, # 按钮权限 - 基础资料 {"id": 22, "parent_id": 3, "menu_name": "定价规则编辑", "menu_path": "", "menu_type": "button", "permission_code": "master-data:update", "icon": "", "sort_no": 22, "status": 1}, @@ -164,6 +165,7 @@ DEFAULT_ROLE_MENU_CODES = { "order:list", "order:create", "order:submit", + "order:update", "customer:list", "reminder:list", "ai:parse-order",