Merge branch 'revert-d0b17c8d' into 'dev'

Fix bug - non-super users could not create servers

See merge request crafty-controller/crafty-commander!245
This commit is contained in:
Andrew 2022-04-10 23:05:25 +00:00
commit 647cf57d2e
2 changed files with 77 additions and 74 deletions

View File

@ -1758,8 +1758,11 @@ class PanelHandler(BaseHandler):
superuser = True
else:
superuser = False
if Enum_Permissions_Crafty.User_Config not in exec_user_crafty_permissions:
if not exec_user["superuser"]:
if (
Enum_Permissions_Crafty.User_Config
not in exec_user_crafty_permissions
):
if str(user_id) != str(exec_user["user_id"]):
self.redirect(
"/panel/error?error=Unauthorized access: not a user editor"
@ -1794,7 +1797,7 @@ class PanelHandler(BaseHandler):
if not self.controller.users.user_id_exists(user_id):
self.redirect("/panel/error?error=Invalid User ID")
return
else:
if password0 != password1:
self.redirect("/panel/error?error=Passwords must match")
return