Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues in rbac.md #4989

Merged
merged 1 commit into from
Apr 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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