diff --git a/docs/Datagrid.md b/docs/Datagrid.md index d066101ec52..4f2c8cb261a 100644 --- a/docs/Datagrid.md +++ b/docs/Datagrid.md @@ -1368,3 +1368,12 @@ export const PostList = () => ( ); ``` + +### Controlling Access To The Columns + +Should your authProvider implements the [`canAccess` method](./AuthProviderWriting.md#canaccess), the `Datagrid` will call it for each record property to ensure it only display the columns users have access to. + +The calls to the [`canAccess` method](./AuthProviderWriting.md#canaccess) will receive the following parameters: + +- `action`: `read` +- `resource`: `[RESOURCE].[PROPERTY]` where `RESOURCE` will be the current React-Admin resource and `PROPERTY` one of the record property. \ No newline at end of file diff --git a/docs/List.md b/docs/List.md index e1b2203eb39..62d4c919563 100644 --- a/docs/List.md +++ b/docs/List.md @@ -1266,3 +1266,14 @@ const ProductList = () => { ``` `useListController` returns callbacks to sort, filter, and paginate the list, so you can build a complete List page. Check [the `useListController`hook documentation](./useListController.md) for details. + +## Controlling Access To The List + +### Controlling Access In Exports + +Should your authProvider implements the [`canAccess` method](./AuthProviderWriting.md#canaccess), the [`exporter`](#exporter) will call it for each record property to ensure it only exports fields to which users have access to. + +The calls to the [`canAccess` method](./AuthProviderWriting.md#canaccess) will receive the following parameters: + +- `action`: `read` +- `resource`: `[RESOURCE].[PROPERTY]` where `RESOURCE` will be the current React-Admin resource and `PROPERTY` one of the record property. \ No newline at end of file