From 163537fd9685e31293a5b7dcabeac24ea0244e0c Mon Sep 17 00:00:00 2001 From: king Date: Mon, 22 Jun 2026 14:53:30 +0900 Subject: [PATCH] =?UTF-8?q?feat(dispatch):=20=EB=B0=B0=EC=B9=98=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EB=B2=84=ED=8A=BC(=EC=8A=88=ED=8D=BC=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20=EC=A0=84=EC=9A=A9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 배치 목록에 삭제 버튼 추가, is_super 일 때만 표시 + 확인창 - 삭제 라우터 권한을 admin → 슈퍼 관리자 전용으로 강화 Co-Authored-By: Claude Opus 4.8 --- app/modules/dispatch/router.py | 8 +++----- app/modules/dispatch/templates/dispatch/batches.html | 6 ++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/modules/dispatch/router.py b/app/modules/dispatch/router.py index 6d5184f..1190782 100644 --- a/app/modules/dispatch/router.py +++ b/app/modules/dispatch/router.py @@ -284,11 +284,9 @@ async def batch_create( async def batch_delete( request: Request, batch_id: int, user: dict[str, Any] = Depends(_require_user) ) -> RedirectResponse: - """배치 삭제 — 관리자 전용(박스/상품/로그 CASCADE).""" - from app.store import is_admin # noqa: WPS433 - - if not is_admin(user): - raise HTTPException(status_code=403, detail="배치 삭제는 관리자만 가능합니다.") + """배치 삭제 — 슈퍼 관리자 전용(박스/상품/로그 CASCADE).""" + if not bool(user.get("is_super_admin")): + raise HTTPException(status_code=403, detail="배치 삭제는 슈퍼 관리자만 가능합니다.") st = _store(request) if st is None: raise HTTPException(status_code=503, detail="dispatch_db 미설정") diff --git a/app/modules/dispatch/templates/dispatch/batches.html b/app/modules/dispatch/templates/dispatch/batches.html index aac62c9..10a3972 100644 --- a/app/modules/dispatch/templates/dispatch/batches.html +++ b/app/modules/dispatch/templates/dispatch/batches.html @@ -37,6 +37,12 @@ 피킹 전달 다운로드 + {% if is_super %} +
+ +
+ {% endif %} {% endfor %}