Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Grav.user.authorize for logged in users

Started by Sergei 7 years ago · 0 replies · 575 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 Duc , 7 hours ago
1 33 7 hours ago
Support · by Thomas, 1 week ago
3 104 16 hours ago
Support · by Anna, 4 days ago
2 101 2 days ago
Support · by Justin Young, 2 days ago
1 67 2 days ago
Support · by Duc , 1 week ago
2 104 6 days ago