添加过滤角色权限

duizhaopin
apan 2 years ago
parent 34c9ccf59f
commit c008dc2f5b

@ -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:

Loading…
Cancel
Save