feat: 若是超管,权限都放开

This commit is contained in:
caoqianming 2024-09-23 13:43:37 +08:00
parent 0b31dad59b
commit b685195706
1 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,8 @@ class MyPermission(RbacPermission):
"""
perms = []
if isinstance(request.user, UserProfile): # 如果是管理员表
if request.user.is_superuser:
return True
perms = cache.get(f'{request.user.id}_perms', None)
if perms is None:
perms = get_permission_list(request.user)