diff --git a/packages/ra-core/src/auth/useGetPermissions.ts b/packages/ra-core/src/auth/useGetPermissions.ts index 51f028379f..9431a80e1f 100644 --- a/packages/ra-core/src/auth/useGetPermissions.ts +++ b/packages/ra-core/src/auth/useGetPermissions.ts @@ -2,6 +2,8 @@ import { useCallback } from 'react'; import useAuthProvider from './useAuthProvider'; +const getPermissionsWithoutProvider = () => Promise.resolve([]); + /** * Get a callback for calling the authProvider.getPermissions() method. * @@ -43,8 +45,6 @@ const useGetPermissions = (): GetPermissions => { return authProvider ? getPermissions : getPermissionsWithoutProvider; }; -const getPermissionsWithoutProvider = () => Promise.resolve([]); - /** * Proxy for calling authProvider.getPermissions() *