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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Login restricted Menu & Pages

Solved by Ross View solution

Started by Ross 11 months ago · 1 replies · 97 views
11 months ago

I would like to have the home page of my GRAV site public but have the rest of the navigation and pages restricted based on login status. I'm currently using .htaccess but this isn't ideal.

I have Grav 1.7+Admin installed.
I setup a test user and a test group.
I added the user to the group.
I set the Group permission to Log In To Site: Allowed
I went to one of my pages under the Security Tab and set the " Menu Visibility Requires Access" to Yes
Under Page Access I added site.login as allowed.
I open the site in a different browser and the menu item for the page remains without logging in.

What am I missing?

11 months ago Solution

Found the solution.

Under the Login Plugin config you need to set the "Dynamic Page Visibility" option to Enabled.

With all the other above settings, this works. Now the issue is caching leaving things visible even after log out and having to refresh a page to flush the page's cache. Disabling caching addresses this but that seems a little extreme.

Documentation on the Security settings could be seriously clarified to avoid the need to sift through the unofficial documentation here.

Might also be nice to compile a separate set of documentation on how to accomplish things using the Admin interface instead of defaulting to modifying the code manually for those that are less confident in that area.

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 85 13 hours ago
General · by pamtbaau, 18 hours ago
1 60 18 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 350 5 days ago
General · by Duc , 6 days ago
3 44 5 days ago