Issue with members only pages

Hi all MODX fans !
Am developing a new personal site w/ MODX 2.7.3 on an Apache server.

I have first configured Members page only as explained below : https://docs.modx.com/current/en/building-sites/client-proofing/security/security-tutorials/making-member-only-pages
i.e. with resource groups/ACL
Caveat being unauthorized users get sent to the error 404 page instead of the unauthorized or login page

I then used Bob’s guide advice per : https://bobsguides.com/blog.html/2013/05/22/protecting-pages-the-easy-way/

Issue : if i use the snippet only, private pages show up in my menu done with Wayfinder

if i use both PrivatePage snippet + resource groups, anonymous users are still sent to the error page first
despite the redirection included into the snippet.
Believe the snippet, despite positoned first on the top of the template must be executed afterwards ?

Any idea or just hint to deal with this issue ?

Many thanks for your help

Resource groups and ACLs will always be evaluated before the page is even constructed, so the snippet will never execute. Pages the user is not authorized to see are treated like unpublished pages. The user is always sent to the error page.

If you want them sent to the unauthorized page instead, you need to give the users load permission for the pages they’re not authorized to see. https://forums.modx.com/thread/28484/solved-404-page-showing-instead-of-unauthorized-page

Ah OK i had not seen that thread.

Again many thanks Bob for your valuable help !

I’m glad I could help. :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.