From 9e5fd579714a5fc74de9c35e1bbbcaaff088b96b Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sun, 16 Jul 2023 16:41:01 +0300 Subject: [PATCH] bugfix to permission merge --- src/controller/commands/Create.ts | 4 +++- src/util/PermissionManager.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controller/commands/Create.ts b/src/controller/commands/Create.ts index 1cc13f4..50fa678 100644 --- a/src/controller/commands/Create.ts +++ b/src/controller/commands/Create.ts @@ -28,9 +28,11 @@ class CreateCommand extends BaseCommand options: [{ name: 'name', type: OptionType.STRING, + flag: true }, { name: 'password', - type: OptionType.STRING + type: OptionType.STRING, + flag: true }, { name: 'admin', type: OptionType.BOOLEAN, diff --git a/src/util/PermissionManager.ts b/src/util/PermissionManager.ts index 0434675..aa88698 100644 --- a/src/util/PermissionManager.ts +++ b/src/util/PermissionManager.ts @@ -111,12 +111,12 @@ class PermissionManager { if (typeof to[key] === 'object') { - PermissionManager.merge(to[key] as Permissions, from[key] as Permissions); + PermissionManager.merge(to[key] as Permissions, from[key] as Permissions, overwrite); } else if (typeof from[key] === 'object') { to[key] = { default: to[key] || 0 }; - PermissionManager.merge(to[key] as Permissions, from[key] as Permissions); + PermissionManager.merge(to[key] as Permissions, from[key] as Permissions, overwrite); } else if (!(key in to) || overwrite) {