fix(rbac): treat govdoc root as frontend route set
This commit is contained in:
@@ -849,6 +849,7 @@ class RbacServiceImpl(IRbacService):
|
|||||||
"/chat-with-llm",
|
"/chat-with-llm",
|
||||||
"/contract-template",
|
"/contract-template",
|
||||||
"/cross-checking",
|
"/cross-checking",
|
||||||
|
"/govdoc",
|
||||||
}
|
}
|
||||||
return any(path in frontendPaths for path in expected)
|
return any(path in frontendPaths for path in expected)
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import pytest
|
|||||||
from starlette.responses import JSONResponse
|
from starlette.responses import JSONResponse
|
||||||
|
|
||||||
from fastapi_modules.fastapi_leaudit.controllers.govdocController import GovdocController
|
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:
|
class _DenyPermissionService:
|
||||||
@@ -126,3 +128,20 @@ async def test_govdoc_list_calls_service_when_permission_granted():
|
|||||||
|
|
||||||
assert response.data["total"] == 0
|
assert response.data["total"] == 0
|
||||||
assert service.list_called is True
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user