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

    I installed de Login snippets to enable user registration and authentication.
    My users are assigned to Webuser group. Fine.

    There’s one resource from the main menu that I’d like show just for authenticated Webuser.

    How can I do?

    Thanks,

    Thierry.
      • 2611
      • 394 Posts
      You should create a new resource group and assign the correct access rights to it.

      Read this and i think all your questions will be answered:
      http://svn.modxcms.com/docs/display/revolution/(Tutorial)+Making+member-only+pages

        Follow me on twitter: @b03tz
        Follow SCHERP Ontwikkeling on twitter: @scherpontwikkel
        CodeMaster
        • 29861
        • 59 Posts
        Thank you for the link. I managed to do exactly what I wanted except for anonymous user only resources (like the Register page).
        Is there a way to do it? I tried creating a Anonymous Only Resource Group and to add the Context Access and the Resource Group Access in the (anonymous) group, but I doesn’t seem to work.

        Another question about user groups: do I have to drag the Administrator group inside the Webuser group, in order to make my administrators automaticaly a Webuser?
          • 3749
          • 24,544 Posts
          Quote from: Thithi32 at Jul 13, 2010, 02:25 PM

          Thank you for the link. I managed to do exactly what I wanted except for anonymous user only resources (like the Register page).
          Is there a way to do it? I tried creating a Anonymous Only Resource Group and to add the Context Access and the Resource Group Access in the (anonymous) group, but I doesn’t seem to work.

          Another question about user groups: do I have to drag the Administrator group inside the Webuser group, in order to make my administrators automaticaly a Webuser?

          Remove the Register page from the resource group. Then it won’t be protected and anonymous users can access it.

          To give the administrators access, you could all the administrator users to the Webuser group, but it might be easier to just update the Administrator group and add a Resource Group Access ACL entry for the protected docs.

          You might find this helpful if you haven’t seen it already: http://bobsguides.com/revolution-permissions.html
            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
            • 29861
            • 59 Posts
            Remove the Register page from the resource group. Then it won’t be protected and anonymous users can access it.
            What I want to do is make the Register page only accessible by anonymous users and not by Webuser and admin ... but that’s not logical so I’ll find another way (like a snippet to do: [[!Authenticated? &then=`...` &else=`...`]]).

            My question about the admin users inheriting webuser permissions was in fact about the "parent" field you can set when creating a new User group. What’s this relation?

            I read your link ... it’s well explained but still complicated to assimilate without more examples in my opinion. But still a good reference.

            Thanks,

            Thierry.
              • 3749
              • 24,544 Posts
              If you are only using the default web context (and if you don’t know, then you are), the following code will tell you if the current user is logged in to the front end:
              $isAuthenticated = $modx->user->hasSessionContext('web');

              If you are using multiple contexts and want to know if the user is logged in to the current context, you can do this:
              $isAuthenticated = $modx->user->hasSessionContext($modx->context->get('key'));

              If you are using multiple contexts and want to know if the user is logged in to any of them, this code will do it:
              $isAuthenticated = $modx->user->hasSessionContext(array('context1', 'context2', 'context3'));
              


              About the parent field: Inheritance of permissions for user groups is planned for the future but not implemented yet.

                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
                • 29861
                • 59 Posts
                Thank you BobRay for those accurate infos.