Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Grav.user.authorize for logged in users

Started by Sergei 7 years ago · 0 replies · 687 views
7 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 complanar, 6 days ago
6 143 19 hours ago
Support · by Rick Beebe, 6 days ago
2 101 3 days ago
Support · by blu3prince, 3 days ago
0 53 3 days ago
Support · by alex, 4 days ago
2 94 3 days ago
Support · by Marcel, 2 weeks ago
1 144 4 days ago