Files
zkxw/backend/tests/test_effective_roles.py
T
zlwuandCursor 06db3bc966 feat(permission): replace OA roles with post-bound roles and assignee posts
Unify effective roles via post-role bindings, remove dedicated OA role UI, and update OA assignee resolution plus related SQL/docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-04 17:41:04 +08:00

17 lines
582 B
Python

"""有效角色解析:直接角色 ∪ 职位继承角色(纯逻辑断言,无 DB 依赖部分)。"""
from app.services.web_auth_roles import _map_role_name_to_web, NO_ROLE_WEB_ROLE
def test_map_role_name_super_admin():
assert _map_role_name_to_web("超级管理员") == "super_admin"
assert _map_role_name_to_web("系统管理员") == "super_admin"
def test_map_role_name_admin_default():
assert _map_role_name_to_web("质检员") == "admin"
assert _map_role_name_to_web("") == "admin"
def test_guest_constant():
assert NO_ROLE_WEB_ROLE == "guest"