Skip to content

Commit 3aac93f

Browse files
committed
Add ability to refetch permissions on demand
1 parent 66f77ca commit 3aac93f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/ra-core/src/auth/usePermissions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const emptyParams = {};
1919
*
2020
* @param {Object} params Any params you want to pass to the authProvider
2121
*
22-
* @returns The current auth check state. Destructure as { permissions, error, isLoading }.
22+
* @returns The current auth check state. Destructure as { permissions, error, isLoading, refetch }.
2323
*
2424
* @example
2525
* import { usePermissions } from 'react-admin';
@@ -54,6 +54,7 @@ const usePermissions = <Permissions = any, Error = any>(
5454
permissions: result.data,
5555
isLoading: result.isLoading,
5656
error: result.error,
57+
refetch: result.refetch,
5758
}),
5859
[result]
5960
);

0 commit comments

Comments
 (0)