We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36760
    • 136 Posts
    Running MODX Revolution 2.1.3-pl (traditional).

    I have a 404 error page, and a Unauthorized page setup in the System Settings. Both pages are Published, but hidden from menus, and neither page has any access permissions set.

    When I try to access a page that has access permissions as a user who is not logged in, I get the 404 error page instead of the Unauthorized page. The page URL is correct for the page I am trying to view, and I can see the page when logged in. Am I understanding how the Unauthorized page is supposed to work correctly, or is that not the intended functionality? I’m able to see the Unauthorized page when I navigate to its URL specifically, it just doesn’t show up on its own.

    I would like to have a page display when a user tries to access a page that exists, but that they don’t have permission to view, so I can add information about how to sign up, etc.

    Thanks for the help!
    • If you want protected Resources (or Resource in protected Contexts) to return 401 vs. 404, anonymous users must have permission to "load" the Resource Group and Context the Resource is in. This makes the Resource accessible for discovery (i.e. it exists) and let’s users know they don’t have access to it explicitly, displaying the unauthorized_page with a 401 response. Otherwise, the users will never know it exists and requests will return a 404 with the error_page.
        • 36760
        • 136 Posts
        Okay, I think I understand what you’re saying, but I might be trying to implement it wrong (I pretty much dove head first into this project and am trying to learn the Revo permission system in a complex setup). Here’s what I did.

        Under Access Controls, I gave the (anonymous) user group a Context Access of web, Member - 9999, Load Only. Then, under Resource Group Access, I gave it access to every resource group I have with web, Member - 9999, Load Only.

        I’m still able to access the Unauthorized page when I navigate to it explicitly when not logged in, but it doesn’t show up when I try to access a page I’m not supposed to be able to see.

          • 36760
          • 136 Posts
          Seems to be working now, forgot about flushing the permissions.

          Thanks for the help.
          • I was glad I came across this thread. I had the same problem after following the tutorial here:

            http://rtfm.modx.com/display/ADDON/Login.Basic+Setup

            There is a similar (more detailed) tutorial here as well:

            http://rtfm.modx.com/display/revolution20/Making+Member-Only+Pages

            I was a bit confused when I couldn't work out why giving the permission to annonymous wouldn't work either, then I realized I was under the administrator group on the browser I was checking in, so I just granted access explicitly to that group as well and it worked. Of course, the corresponding action would be (in most cases) to add the admin users to that usergroup as well, but I wanted to make sure I had full grasp at the concept in hand.

            The permission structure in modx is so strong and well structure it can be a little complicated to understand at first glance.
              • 3749
              • 24,544 Posts
              That's one of several problems you can avoid if you always add yourself (the admin) to all user groups with a role of Super User.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
              • Ok, I've done all of this, and am still getting the 404 not found page when I'm not logged in as admin.

                Ah! Flushed sessions as well, and now it works.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org