fix(rbac): treat govdoc root as frontend route set

This commit is contained in:
wren
2026-05-25 10:47:55 +08:00
parent a6efa87616
commit 533424c9fe
2 changed files with 20 additions and 0 deletions
@@ -849,6 +849,7 @@ class RbacServiceImpl(IRbacService):
"/chat-with-llm",
"/contract-template",
"/cross-checking",
"/govdoc",
}
return any(path in frontendPaths for path in expected)
+19
View File
@@ -4,6 +4,8 @@ import pytest
from starlette.responses import JSONResponse
from fastapi_modules.fastapi_leaudit.controllers.govdocController import GovdocController
from fastapi_modules.fastapi_leaudit.domian.vo.rbacVo import RbacRouteVO
from fastapi_modules.fastapi_leaudit.services.impl.rbacServiceImpl import RbacServiceImpl
class _DenyPermissionService:
@@ -126,3 +128,20 @@ async def test_govdoc_list_calls_service_when_permission_granted():
assert response.data["total"] == 0
assert service.list_called is True
def test_govdoc_root_route_marks_frontend_route_set_ready():
"""只有内部公文模块路由时也视为新版路由,避免兼容菜单补出列表和上传。"""
service = RbacServiceImpl()
routes = [
RbacRouteVO(
id=1,
route_path="/govdoc",
route_name="govdoc",
component="govdoc",
parent_id=None,
route_title="内部公文处理",
)
]
assert service._isFrontendRouteSetReady(routes) is True