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: [{
name: 'name',
type: OptionType.STRING,
flag: true
}, {
name: 'password',
type: OptionType.STRING
type: OptionType.STRING,
flag: true
}, {
name: 'admin',
type: OptionType.BOOLEAN,

View File

@ -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)
{