We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31902
    • 342 Posts
    How does one hide a particular component from lower level editors but not the admin, but still keep the top level components menu item visible (so other components can be made available to lower level editors)?

    In this case, I installed Janitor and everything is working great. However, I don't want lower level editors, i.e., clients to be able to see/touch the component. Right now, the Janitor component is accessible from the top of the page within Components > Janitor. I don't want to make the whole menu hidden because there are other components that I do want the client to use. I just want to target Janitor.

    I tried going to Security > Access Controls and in User Groups tab, right-click the Administrator group. Then, choose Update User Group, go to Element Category Access tab and click Add Category. Then, choose the Janitor category, minimum role of 9999, access policy of Element and a context of mgr.

    No effect.

    I looked to see if it had its own access policy but it doesn't..

    This is one of those "I feel dumb for asking..." questions. Thanks in advance.
      • 3749
      • 24,544 Posts
      You're on the right track, but if you want to hide that element from non-administrators, you just need to set a minimum role with a lower authority number than the one belonging to the users you want to hide if from (lower numbers = more authority). If you want to hide it from everyone but the admin, set the minimum role to 'Super User'.

      The word 'minimum' there can be misleading. It means minimum authority number to have the policy apply. By setting it to 9999, you've given everyone access to it.

      BTW, if the users you want to hide it from are not in the Administrator group (and there's no Element Category Access ACL entry for that category in their user group), what you did should hide the element from them regardless of the authority level you set and you'll have more flexibility with form customization rules, since those can be applied to specific user groups.
        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
        • 31902
        • 342 Posts
        Thanks, Bob. I just tried that and it still didn't work. Out of curiosity: when I look at the Categories section within the Elements tree, I see a whole list of categories. When I highlight any of those categories, they appear to be empty. With my Janitor component situation, should there be something inside the Janitor category for it to hide?

        For instance, whenever I want to hide certain template variables from users, I follow the above-mentioned procedure but before I do that, I make sure that I first create a category (for instance, one called HiddenItems) within the TV section, then place all my TVs in there that I want to hide. Then I do the above mentioned procedure (using minimum authority of Member - 9999). Save and flush permissions. That hides the TVs nicely from lower level users.

        In the Janitor menu hiding situation, I don't see how/where I can place anything within the Janitor Category. Should something be placed in there? It looks like all I'm doing is hiding an empty category that just so happens to be called 'Janitor'. I'm obviously not understanding something basic.

        Thanks for your help. [ed. note: waizen last edited this post 14 years, 10 months ago.]
          • 31902
          • 342 Posts
          So, now I'm trying this:

          Taking Bob's posting on the thread on this page: https://forums.modx.com/index.php?topic=53212.0 I created a new top level menu item called 'Hidden'. To do this, I went to System > Actions. In the Top Menu panel, I clicked 'Create Menu' button. Called it 'Hidden'. In the Action dropdown I selected 'No Action1'.

          I dragged the Janitor menu item from the Components top level menu and placed it under 'Hidden' top level menu.

          Right-clicked 'Hidden' top level menu item and selected update menu. In 'Permissions' field, I added 'view_Janitor' and hit 'Save'.

          At that point, I noticed that the 'Hidden' top menu item disappeared from the top of the page.

          I went to Security > Access Controls and selected Policy Templates. Right-clicked AdministratorTemplate and selected Update Policy Template. Clicked on 'Add Permission to Template' and in the Name field, added 'view_Janitor' (the permission name I had added to the Janitor menu item earlier). Clicked 'Add'.

          Went to Security > Access Controls > Access Policies, right-clicked Administrator > Update Policy and found the 'view_Janitor' permission. Checked the box to activate it. Hit Save.

          Refreshed the screen but the 'Hidden' top level menu item is still invisible to me (the administrator).

          Not sure what is going on here... I thought all this gave me (the administrator) permission to view the Hidden > Janitor menu items.

          What am I missing? Thank you in advance. [ed. note: waizen last edited this post 14 years, 10 months ago.]
            • 31902
            • 342 Posts
            Actually, it's now working. What I did was open up a different browser (I had been using Firefox to do all this) and took a look at the menu items in IE. Whether its was a cache thing or a session id thing, who knows, but now it's working. Closed all instances of Firefox and opened it up again, cleared the cache and took a look...working fine.

            ...so...

            It looks like the last batch of steps I listed was the answer to my problem. Hope it helps somebody.
              • 3749
              • 24,544 Posts
              I'm glad you got it working. Thanks for reporting back. smiley
                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