Limit website page view by user role

I have a website where customers can sign in. When they do so, they are allocated one of two types of membership.
I can limit access to prices in the website using…
if ($kirby->user()):

What I really want to do is limit access to only one type of member role. Is this possible?

You can use ->role() and perform all your checks and do what you want to do depending on the current user’s role.

More here: $user->role() | Kirby CMS

Brilliant, thanks

1 Like