import { ComponentType } from 'react'; import { Location } from 'history'; export interface WithPermissionsProps { authParams?: object; component?: ComponentType; location?: Location; staticContext?: object; [key: string]: any; } /** * After checking that the user is authenticated, * retrieves the user's permissions for a specific context. * * Useful for Route components ; used internally by Resource. * Use it to decorate your custom page components to require * a custom role. It will pass the permissions as a prop to your * component. * * You can set additional `authParams` at will if your authProvider * requires it. * * @example * import { WithPermissions } from '../app'; * * const Foo = ({ permissions }) => ( * {permissions === 'admin' ?

Sensitive data

: null} *

Not sensitive data

* ); * * const customRoutes = [ * * } * /> * } /> * ]; * const App = () => ( * * ... * * ); */ declare const WithPermissions: React.FC; export default WithPermissions;