We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45674
    • 13 Posts
    I started using ModX for the first time today and I really like how everything is highly customizable about it. I am currently trying to build the user system the way I want it to be but I am struggling with something very simple. I am using the bootstrap theme and included the login form in the same way as it is shown here. I've had quite some trouble customizing everything such that it looked and worked as I wanted to. Eventually though, the login and logout form/button were working as expected.

    Now I wanted to add a simple profile page for logged in members. I created a resource group and configured it as shown here. Then, I created a resource and checked the corresponding resource-group in the resource-groups tab. This led to the following result: The navigation permanently shows the link to the resource I just created, no matter whether I'm logged in or not. However, the resource is only accessible when logged in (anonymous is redirected to the "home" page).

    I googled for a while and tried everything I found. I tried viewing only the front-end in a different browser, emptying cache, reloading permissions and resetting all sessions. None of those things changed a single thing. What could be the problem?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It may depend on your Manager login status. Have you tried when logged out of the Manager, or with a different browser that isn't logged in?
        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
        • 45674
        • 13 Posts
        I already tried that several times, as stated in the original post too.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Sorry, I missed that.

          There are three reasons why I've had similar issues, Manager login status, the pages with the menus being cached when viewed while logged in as a Manager user, and not getting the permissions quite right. Sounds like in this case it's a permissions setting. In these cases, I usually have to remove all my custom groups and ACL stuff and try again. Revo permissions is not pleasant.
            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
            • 45674
            • 13 Posts
            I removed the resource, the resource group and the user group and recreated everything again. The same problem occurs.
              • 3749
              • 24,544 Posts
              One option would be to use the Personalize snippet, which shows one chunk to logged-in users and another to not-logged-in users. You could put the link in the "Yes" chunk. Be sure to call the snippet uncached:

              [[!Personalize? ... ]]
                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
                • 45674
                • 13 Posts
                I have been looking for other options to include the link but this seems really ugly considering there will be many more links. I'd rather find the root of the problem and fix it, to be honest.
                  • 3749
                  • 24,544 Posts
                  MODX doesn't really have a built-in way to asses permissions for naked links in a way that lets you display nothing if the user doesn't have access.

                  You could use an output modifier on the user ID (which is 0 for anonymous users), though that will slow page loads a little more than Personalize:


                  [[+modx.user.id:gt=`0`:then=`<a href="[[~12]]">Link Text</a>`:else=``]]


                    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
                    • 45674
                    • 13 Posts
                    The way I understood it, ModX is supposed to not show links in the navigation to people who do not have the permission to access that link. Is this completely wrong?
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      This is using Wayfinder?
                        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