Bugfix to permission updates
This commit is contained in:
parent
e76fab36ed
commit
9aae5b576a
@ -91,10 +91,10 @@ class Registry
|
||||
if (!(endpoint instanceof Endpoint))
|
||||
throw new Error(`Attempt to load invalid endpoint at ${file.name}`);
|
||||
if (endpoints.has(endpoint.resolveable))
|
||||
throw new Error(`Error registering endpoint ${endpoint.resolveable}: an endpoint with that resolveable already exists`);
|
||||
throw new Error(`Error registering endpoint ${endpoint.resolveable} from file ${file.name}: an endpoint with that resolveable already exists`);
|
||||
|
||||
endpoints.set(endpoint.resolveable, endpoint);
|
||||
logger.info(`Created endpoint ${endpoint.name}`);
|
||||
logger.info(`Created endpoint ${endpoint.name} from file ${file.name}`);
|
||||
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ class Entity
|
||||
this.#_id = id;
|
||||
this.#_name = name;
|
||||
this.#_disabled = disabled ?? false;
|
||||
this.#_permissions = PermissionManager.merge(permissions || {}, PermissionManager.DefaultPermissions);
|
||||
this.#_permissions = PermissionManager.merge(PermissionManager.DefaultPermissions, permissions || {});
|
||||
this.#_createdTimestamp = createdTimestamp ?? Date.now();
|
||||
this.#_cachedTimestamp = Date.now();
|
||||
this.#_note = note ?? null;
|
||||
|
@ -118,7 +118,7 @@ class PermissionManager
|
||||
PermissionManager.merge(to[key] as Permissions, from[key] as Permissions);
|
||||
// eslint-disable-next-line no-undefined
|
||||
}
|
||||
else if (!(key in to))
|
||||
else // if (!(key in to))
|
||||
{
|
||||
to[key] = from[key];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user