bugfix to permission merge

This commit is contained in:
Erik 2023-07-16 16:41:01 +03:00
parent b4cec3f1a5
commit 9e5fd57971
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68
2 changed files with 5 additions and 3 deletions

View File

@ -28,9 +28,11 @@ class CreateCommand extends BaseCommand
options: [{ options: [{
name: 'name', name: 'name',
type: OptionType.STRING, type: OptionType.STRING,
flag: true
}, { }, {
name: 'password', name: 'password',
type: OptionType.STRING type: OptionType.STRING,
flag: true
}, { }, {
name: 'admin', name: 'admin',
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,

View File

@ -111,12 +111,12 @@ class PermissionManager
{ {
if (typeof to[key] === 'object') 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') else if (typeof from[key] === 'object')
{ {
to[key] = { default: to[key] || 0 }; 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) else if (!(key in to) || overwrite)
{ {