I am using react-admin and I am looking at the documentation page for creating page with permissions
The example shows:
const MyPageWithPermissions = ({ location, match }) => (
<WithPermissions
authParams={{ key: match.path, params: route.params }}
// location is not required but it will trigger a new permissions check if specified when it changes
location={location}
render={({ permissions }) => <MyPage permissions={permissions} /> }
/>
);
export default MyPageWithPermissions;
First of all:
route
is not defined, what is the real value?I would like to know:
authParams
used for? Is it required or optional?authParams
be skipped?WithPermissions
Component?Those are for custom params you'd like to check in your authProvider
. They will be passed to it when WithPermissions
calls it.
They are optional though as you can see in the next example for a custom menu