We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24598
    • 17 Posts
    Hi - I creating a web site and would like to limit the links a web user sees when they log into the site. I have 4 types of membership levels. for simplicity lets call them level-1, level-2, level-3, and level-4

    there are 4 different pages. page1, page2, page3, and page4

    level-4 gets acess to all pages ( page1-page4 )
    level-3 gets access to only pages ( page1, page2, and page3 )
    etc..

    I tried finding an equivalent function that REVO has like isMember and then including the chunk but that didnt work. Seems like this should be a standard feature but sort of stumped.

    Anyone else solve this? and/if so how?

    many thanks in advance.

    rob...

    This question has been answered by rbaigert. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Evo permissions are fairly simple.

      You'll need four sets of web user groups and resource groups.

      Assign your users to as many groups as necessary to give them access to the pages they'll need. For example, level 4 users would be assigned to all four web user groups.
        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
      • discuss.answer
        • 24598
        • 17 Posts
        I understand the web users groups... ( I think ) but my problem is a bit more complex. Once a user registers, and are logged in - all members are directed to a members landing page. Call it members...

        if your a level4 user you are shown all links..

        if your a level3 user you are shown 3 links..

        I was trying to limit the links based on the users group...wasnt sure if should use chunks and perhaps only display the chunks based on the levels...

        Does that make sense?

        something like this....

        <?php
        /* InGroup snippet */
        $output = "";
        if ($modx->user->isMember('bigbuck')) {
        $output = $modx->getChunk('bigbucklink');
        } else if ($modx->user->isMember('lilbuck')) {
        $output = $modx->getChunk('lilbucklink');
        } else {
        $output = $modx->getChunk('chunk3');
        }
        return $output;
        ?>
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Wayfinder will respect the user's permissions, as will Ditto.
            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