bugfix to permission merge
This commit is contained in:
parent
b4cec3f1a5
commit
9e5fd57971
@ -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,
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user