Skip to content

Commit 9fac8db

Browse files
committed
[Doc] Add video tutorial to Access Control documentation
1 parent a6e1b97 commit 9fac8db

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/Permissions.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@ title: "Authorization"
55

66
# Authorization
77

8+
<iframe src="https://www.youtube-nocookie.com/embed/2loA65et3JU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;"></iframe>
9+
810
Once a user is authenticated, your application may need to check if the user has the right to access a specific resource or perform a particular action. React-admin provides two ways to do so:
911

1012
1. **Access control** relies on `authProvider.canAccess({ resource, action })`, which returns whether the user can access the given resource and action.
1113
2. **Permissions** rely on `authProvider.getPermissions()`, which returns a list of permissions that your components can inspect.
1214

1315
Depending on your needs, you can implement one or the other or both. We recommend Access Control because it allows you to put the authorization logic in the `authProvider` rather than in the code.
1416

15-
<video controls autoplay muted loop>
16-
<source src="./img/AccessControl.mp4" type="video/mp4"/>
17-
Your browser does not support the video tag.
18-
</video>
19-
2017
## Access Control
2118

2219
With Access Control, the `authProvider`is responsible for checking if the user can access a specific resource or perform a particular action. This flexibility allows you to implement various authorization strategies, such as:
@@ -27,6 +24,11 @@ With Access Control, the `authProvider`is responsible for checking if the user c
2724

2825
Use the `authProvider` to integrate react-admin with popular authorization solutions like Okta, Casbin, Cerbos, and more.
2926

27+
<video controls autoplay muted loop>
28+
<source src="./img/AccessControl.mp4" type="video/mp4"/>
29+
Your browser does not support the video tag.
30+
</video>
31+
3032
### `authProvider.canAccess()`
3133

3234
To use Access Control, the `authProvider` must implement a `canAccess` method with the following signature:

0 commit comments

Comments
 (0)