From 8008d2ced1fa11b0e77b99bd98ddf7c27f801e37 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 17 Oct 2024 11:53:20 +0200 Subject: [PATCH] Fix all references --- packages/backend-core/src/security/roles.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/security/roles.ts b/packages/backend-core/src/security/roles.ts index cd9217d6008..2fcde768bc1 100644 --- a/packages/backend-core/src/security/roles.ts +++ b/packages/backend-core/src/security/roles.ts @@ -384,8 +384,8 @@ export async function getAllRoles(appId?: string): Promise { } async function shouldIncludePowerRole(db: Database) { - const app = await db.get(DocumentType.APP_METADATA) - const { creationVersion } = app + const app = await db.tryGet(DocumentType.APP_METADATA) + const creationVersion = app?.creationVersion if (!creationVersion) { // Old apps don't have creationVersion, so we should include it for backward compatibility return true