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

    I(m trying to automatically automatically restrict a whole context (dev.mymodx.net, all resources) to Administrator group, without success.

    I added to context access permissions :

    dev

    User group: Administrator

    Auth. : 9999

    Access policiy : Load, List and View

    but context resources don't load when I logged as admin.

    Any idea?

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

      MODX lover
      -
      Développeur MODX / Webdesign / Solutions web
      • 3749
      • 24,544 Posts
      Assuming that you want full access to resources in that Context for admins, change the policy to Administrator. I would also change the Auth. to 0.

      Flush permissions and flush all sessions after making the change.

      The context should then be hidden from all non-admins. If you want others to have partial access (e.g., see the resources but not edit them), put them in a separate group and create an ACL like the one you did originally for that group.

        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
        • 46580
        • 167 Posts
        I tried :

        Context: dev
        User group: Administrator
        access policy: 0
        Authority: Administrator

        resources don't display when I'm logged as admin from modX manager and front-end (> redirection to the web context default homepage).

        Need I put context resources in a "dev" resource group?
          MODX lover
          -
          Développeur MODX / Webdesign / Solutions web
          • 3749
          • 24,544 Posts
          In the front end, you would have to have something like &contexts=`web,dev` in the Login snippet tag.

          I can't think of any reason you wouldn't be able to see the resources in the Manager, though, unless they're in a protected resource group, or they're 'Articles', which don't show up in the tree.

          Not having the 'dev' context at the root of the tree could also be a factor.

            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
          • discuss.answer
            • 46580
            • 167 Posts
            I found an alternative working method after having read Login to multiple contexts (HTTP & HTTPS) (https://forums.modx.com/thread/44880/solved-login-to-multiple-contexts-http-https).

            As I suspected a problem with the propagation of login/logout status to context / sub-domains I added in System settings the value ".mydomain.net" to the session_cookie_domain key (some methods I tried works fine for the web context, not for subdomains contexts).

            Then checked that the 'dev' context was not in 'anonymous' user group and added in 'Administrator' user group 'dev' context (Minimum Role > Super User / Access policy > Context).

            With these settings dev.mydmodx.net subdomain and resources are only allowed for logged administrators, front-end (no need to specify &context='dev' for the Login snippet) or back end.

            Just for the precision, I use Xrouting extra do dispatch subdomains to contexts.
              MODX lover
              -
              Développeur MODX / Webdesign / Solutions web