diff --git a/src/server/components/Registry.ts b/src/server/components/Registry.ts index b97aa1e..081516c 100644 --- a/src/server/components/Registry.ts +++ b/src/server/components/Registry.ts @@ -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}`); } diff --git a/src/server/interfaces/Entity.ts b/src/server/interfaces/Entity.ts index 3f49ab2..4be6e99 100644 --- a/src/server/interfaces/Entity.ts +++ b/src/server/interfaces/Entity.ts @@ -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; diff --git a/src/util/PermissionManager.ts b/src/util/PermissionManager.ts index 26235f5..87031b5 100644 --- a/src/util/PermissionManager.ts +++ b/src/util/PermissionManager.ts @@ -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]; }