Implement RBAC
This commit is contained in:
@ -2,7 +2,11 @@
|
||||
import { Link } from '@redwoodjs/router'
|
||||
import { Metadata } from '@redwoodjs/web'
|
||||
|
||||
import { useAuth } from 'src/auth'
|
||||
|
||||
const HomePage = () => {
|
||||
const user = useAuth()
|
||||
|
||||
return (
|
||||
<>
|
||||
<Metadata title="Home" description="Home page" />
|
||||
@ -15,6 +19,7 @@ const HomePage = () => {
|
||||
My default route is named `home`, link to me with:
|
||||
`<Link to={routes.home()}>Home</Link>`
|
||||
*/}
|
||||
{user && user.isAuthenticated + ' ' + user.hasRole('admin')}
|
||||
<Link to={'/login'}>Login</Link>
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user