From 437b697ffa3582fbedc0a786572e93f4b2b3e422 Mon Sep 17 00:00:00 2001 From: dfahlander Date: Mon, 30 Oct 2023 17:41:07 +0100 Subject: [PATCH] dexie-react-hooks: Allow plain interfaces for usePermissions() --- addons/dexie-cloud/src/permissions.ts | 2 +- libs/dexie-react-hooks/src/usePermissions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dexie-cloud/src/permissions.ts b/addons/dexie-cloud/src/permissions.ts index 36559e104..db03d28f1 100644 --- a/addons/dexie-cloud/src/permissions.ts +++ b/addons/dexie-cloud/src/permissions.ts @@ -43,7 +43,7 @@ export function permissions( return new PermissionChecker( realm.permissions, tableName!, - realmId === dexie.cloud.currentUserId || owner === dexie.cloud.currentUserId + realmId === undefined || realmId === dexie.cloud.currentUserId || owner === dexie.cloud.currentUserId ); }; const o = source.pipe(map(mapper)) as Observable> & { diff --git a/libs/dexie-react-hooks/src/usePermissions.ts b/libs/dexie-react-hooks/src/usePermissions.ts index bb78d1a00..9a0c727de 100644 --- a/libs/dexie-react-hooks/src/usePermissions.ts +++ b/libs/dexie-react-hooks/src/usePermissions.ts @@ -41,7 +41,7 @@ export function usePermissions( >; export function usePermissions< TDB extends Dexie, - T extends { realmId: string; owner: string } + T >(db: TDB, table: TableProp, obj: T): PermissionChecker>; export function usePermissions( firstArg: