Skip to content

Commit

Permalink
dexie-react-hooks: Allow plain interfaces for usePermissions()
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Oct 30, 2023
1 parent 717d965 commit 437b697
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addons/dexie-cloud/src/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<PermissionChecker<any>> & {
Expand Down
2 changes: 1 addition & 1 deletion libs/dexie-react-hooks/src/usePermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function usePermissions<T extends DexieCloudEntity>(
>;
export function usePermissions<
TDB extends Dexie,
T extends { realmId: string; owner: string }
T
>(db: TDB, table: TableProp<TDB>, obj: T): PermissionChecker<T, TableProp<TDB>>;
export function usePermissions(
firstArg:
Expand Down

0 comments on commit 437b697

Please sign in to comment.