From 1ea78ea0c703532675efed3eae702a5c03d682b6 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:05:08 +0800 Subject: [PATCH] fix: role authentication (#3263) --- apps/common/auth/authentication.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/common/auth/authentication.py b/apps/common/auth/authentication.py index e9d85af47..14ea28a69 100644 --- a/apps/common/auth/authentication.py +++ b/apps/common/auth/authentication.py @@ -34,7 +34,7 @@ def exist_role_by_role_constants(user_role: List[RoleConstants], :param role_list: 需要拥有的角色 :return: 是否拥有 """ - return any(list(map(lambda up: role_list.__contains__(up), user_role))) + return any([True for role in role_list if user_role.__contains__(role.value.__str__())]) def exist_permissions_by_view_permission(user_role: List[RoleConstants],