瀏覽代碼

HUE-8530 [organization] Make user superuser only explicitly

Romain 5 年之前
父節點
當前提交
4c347cc76c
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      desktop/core/src/desktop/auth/backend.py

+ 2 - 3
desktop/core/src/desktop/auth/backend.py

@@ -171,9 +171,8 @@ def create_user(username, password, is_superuser=True):
 
   if ENABLE_ORGANIZATIONS.get():
     user.is_admin = is_superuser or not organization.organizationuser_set.exists() or not organization.is_multi_user
-    user.is_superuser = not User.objects.exists()
-  else:
-    user.is_superuser = is_superuser
+
+  user.is_superuser = is_superuser
 
   user.save()