Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Grav.user.authorize for logged in users

Started by Sergei 8 years ago · 0 replies · 720 views
8 years ago

I use this to show part of the page to users with 'some.rule' access:

TWIG
{% if grav.user.authorize('some.rule') %}
My content
{% endif %}

The problem is:

if the admin grants access while the user is already logged in, it doesn’t work. In other words, user has to logout and login to see the hidden content.

Can it be fixed?

Can I hide part of a page for group of users somehow else?

Thanks!

Suggested topics

Topic Participants Replies Views Activity
Support · by webmasterodp, 1 week ago
4 157 6 days ago
Support · by nwhitfield, 1 week ago
2 135 1 week ago
Support · by stell, 3 weeks ago
5 369 2 weeks ago
Support · by gravinator, 1 month ago
5 559 2 weeks ago
Support · by Gravver, 3 weeks ago
6 347 3 weeks ago