We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47768
    • 14 Posts
    Hello,

    I'm new to MODX, I'm trying to get the hang of user groups and roles, and the whole permission system.

    I have a vanilla install, and I have created an additional group Developer, to which I assigned the default admin user. Access Controls clearly show that the user admin belongs to both Administrator and Developer groups.

    In my TemplateBase I have the following:

    Administrator:  [[!+modx.user.id:memberof=`Administrator`:then=`MEMBER`:else=`NON-MEMBER`]]
    Developer:      [[!+modx.user.id:memberof=`Developer`:then=`MEMBER`:else=`NON-MEMBER`]]
    Fake:           [[!+modx.user.id:memberof=`Fake`:then=`MEMBER`:else=`NON-MEMBER`]]
    


    Which gives the output:

    Administrator: MEMBER
    Developer: NON-MEMBER
    Fake: NON-MEMBER

    What's happening here?
    I then digged into modoutputfilter.class.php and had a confirmation:

    $user->isMember('Developer')


    does return FALSE.

    Am I missing something?

    Thank you for any help,
    - m

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

      --
      MODX Revolution 2.2.14-pl (traditional)
    • discuss.answer
      • 3749
      • 24,544 Posts
      If you're previewing the front end from the Manager, your status is ambiguous. You may not be seen as a member of the Developer group until you specifically log in in the front end.

      Also make sure the name of the group is not 'developer' (small d) and that you flushed permissions and flushed all sessions on the Security menu after creating the group and adding the 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
        • 47768
        • 14 Posts
        Thank you, flushing all sessions in the end did the trick.

        This was ok since I'm just experimenting locally, but let's say in the future I have a community of 30000 users, and I have to assign a few administrators to a newly created group, do I really have to log out all 30k users?
          --
          MODX Revolution 2.2.14-pl (traditional)
          • 3749
          • 24,544 Posts
          I think you need to do that only if the people online need to be affected by the update. I could be wrong.
            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
            • 47768
            • 14 Posts
            Makes sense, I'll experiment a bit maybe.

            Thank you for the fast reply!
              --
              MODX Revolution 2.2.14-pl (traditional)
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I always use a "test" user for this sort of thing, and use a different browser where I am not logged in as a Manager user for testing anything to do with permissions. You can get all kinds of unexpected results when testing permission-related processes when you're logged in as a Manager user.
                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