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

    I noticed that if I don't have view_user checked in the "Access Policy" for one of my user groups, I can't save a resource. I get a modal that states "Error" code: 200 ok and then a json response of "success":false,"message":"Permission denied!","total":0,"data":[],"object":[]} in the modal window.

    However when that is checked I can view manage users and permissions under the manage window in the top menu bar.
    Is there a way to remove the manage users and still be able to save a resource?

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

      • 42766
      • 47 Posts
      Do you happen to be running VersionX on this site? If so, I've got a solution for you if you haven't found one already.
        • 36723
        • 94 Posts
        Yes, we are running version x. Any help is appreciated.
        • discuss.answer
          • 42766
          • 47 Posts
          OK, so the error is related to VersionX calling on the user_view permission as it loads the 'Versions' tab (as opposed to anything going on in the MODX core). This one had me stumped for a while too!

          In my case, I want access to that tab as administrator, but I'm not actually wanting my users in the affected permission group to be able to see it.

          If you're in that position, here's how to hide that for your users. These instructions are specific for the 2.3 manager layout - everything is likely to be in a different place in other versions, but the underlying concepts still apply.

          (Apologies if these instructions are over-simplified for your experience level - I like to give answers with heaps of detail because I know how helpful that was in these forums when I was a beginner!)

          To stop the Versions tab from loading for your users when they're editing Resources
          1. go to the top-right cog menu > 'Access Control Lists'
          2. select the 'User Groups' tab if not already selected
          3. right click the group you want to have the tab disappear for and choose 'Update User Group'
          4. select the 'Settings' tab if not already selected
          5. click 'Create New'
          6. fill in the details as follows:
            Key: versionx.formtabs.resource
            Field Type: Yes/No
            Namespace: versionx
            Value: No
          7. 'Save' in that window and then 'Save' in the manager page
          8. your users will likely need to log out and back in to see the affects of this permission update - you can expedite that by selecting 'Manage' > 'Logout all users'. Keep in mind this will kill their sessions cold - they may lose data if they're in the middle of something and haven't saved.

          If they also have access to edit things that aren't resources (such as templates, chunks, snippets etc), you'll need to repeat the above steps for each thing they have access to. The relevant keys to add instead of versionx.formtabs.resource are versionx.formtabs.chunk, versionx.formtabs.plugin, versionx.formtabs.snippet, versionx.formtabs.template, versionx.formtabs.templatevariables. Hopefully it's obvious what applies to what! smiley

          From there you're free to go back and edit the relevant access policy for the group and remove view_user permission because they won't need it with that tab not loading.

          Now, if you want them to maintain access to VersionX but not see the menu item in the manager, I'm working on a solution to that which I'll report below when I have it. [ed. note: jcdm last edited this post 8 years, 9 months ago.]
            • 3749
            • 24,544 Posts
            Great job of presenting this information! smiley

            I'm sure people will find it useful.
              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
              • 42766
              • 47 Posts
              The amazing BobRay has a step by step tutorial on his site for hiding a menu item in the top menu using the permissions system. His procedure is here: http://bobsguides.com/hiding-top-menu-items-in-the-manager.html

              Haven't had a chance to test this one so I'd love to hear how you get along should you need to try it. [ed. note: jcdm last edited this post 8 years, 9 months ago.]
                • 42766
                • 47 Posts
                Thanks BobRay - high praise from the man who (actually) wrote the book! smiley
                  • 36723
                  • 94 Posts
                  Wow this is great. I really appreciate the thorough answer.
                    • 3749
                    • 24,544 Posts
                    Aw shucks. wink
                      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