Skip to content

Commit

Permalink
Fix issues in rbac.md
Browse files Browse the repository at this point in the history
1. `role` => `roles`. `role` was replaced by `roles` in #4681
2. updated user role example.
  • Loading branch information
chenliu9 authored Apr 2, 2022
1 parent b75310a commit a1f90fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/docs/tutorial/chapter7/rbac.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ export const getCurrentUser = async (session) => {
### Restricting Access via Routes
The easiest way to prevent access to an entire URL is via the Router. The `<Private>` component takes a prop `role` in which you can give a list of only those role(s) that should have access:
The easiest way to prevent access to an entire URL is via the Router. The `<Private>` component takes a prop `roles` in which you can give a list of only those role(s) that should have access:
```jsx title="web/src/Routes.js"
// highlight-next-line
<Private unauthenticated="home" role="admin">
<Private unauthenticated="home" roles="admin">
<Set wrap={PostsLayout}>
<Route path="/admin/posts/new" page={PostNewPostPage} name="newPost" />
<Route path="/admin/posts/{id:Int}/edit" page={PostEditPostPage} name="editPost" />
Expand All @@ -108,7 +108,7 @@ yarn rw c
Now we can update our user with a single command:
```bash
> db.user.update({ where: { id: 1 } }, data: { roles: 'admin' } })
> db.user.update({ where: { id: 1 } , data: { roles: 'admin' } })
```
Which should return the new content of the user:
Expand Down

0 comments on commit a1f90fe

Please sign in to comment.