From c008dc2f5bb26a3c77ee6b7a1dc161f7c66d0a14 Mon Sep 17 00:00:00 2001 From: apan Date: Fri, 5 Aug 2022 14:39:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=87=E6=BB=A4=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/power/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/power/views.py b/apps/power/views.py index d5de2b0..e8829fe 100644 --- a/apps/power/views.py +++ b/apps/power/views.py @@ -6,7 +6,7 @@ import sys sys.path.append('.') -from sqlalchemy import or_ +from sqlalchemy import and_, or_ from db_logic.module import BllModule from db_logic.role import BllRole from Common.auth import token_auth @@ -51,7 +51,11 @@ def add_user_power_list(): "5": instrument_modulet if instrument_modulet else [], } # 删除除去柜子权限外的所有权限 - BllModuleRelation().delete(EntityModuleRelation.object_id == user_id, EntityModuleRelation.module_type != "1") + BllModuleRelation().delete( + and_(EntityModuleRelation.object_id == user_id, + EntityModuleRelation.module_type != "1", + EntityModuleRelation.object_type != "1") + ) inster_module_list = [] for k,v in inster_dic.items(): for i in v: