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: