Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed Sep 5, 2024
1 parent 521c567 commit 6e70ac0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/Datagrid.md
Original file line number Diff line number Diff line change
Expand Up @@ -1368,3 +1368,12 @@ export const PostList = () => (
</List>
);
```

### 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.
11 changes: 11 additions & 0 deletions docs/List.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 6e70ac0

Please sign in to comment.