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

    I want to allow Editors to choose a Template for their pages but restrict this to just a few of the Templates and I'm not sure how to do this.
    I went through this tutorial for restricting elements by placing them in a Category(http://rtfm.modx.com/display/revolution20/Restricting+an+Element+from+Users) so i checked the Templates option in Form Customization but all Templates displayed in the dropdown when i logged in as an Editor.
    Am I doing something wrong or is there another way to do this?

    thanks for any help

    J
    [ed. note: 9thwave last edited this post 14 years ago.]
      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 3749
      • 24,544 Posts
      That documentation tells how to allow users to see templates, but it doesn't really show how to hide them.

      To hide them from a group of users, you need to put the Templates they *shouldn't* see into a category and connect that category to a user group (e.g., Administrator), that the users don't belong to with an Element Category Access ACL entry.

      IOW, put all the templates on the site into a category (call it AllTemplates). Then update the Administrator user group. On the Element Category Access tab, create a new entry with these values:

      Context: mgr
      Category: AllTemplates
      Minimum Role: admin Super User
      Access Policy: Element
      

      That will hide all templates from the Editors. In theory, that should hide them in the drop-down. Check to see.

      Use the steps at rtfm to give the Editors rights to just the Templates they should have access to.
      Note that the Editors won't be able to edit resources that use Templates they can't see. If that's a problem, see the note at rtfm.

      You shouldn't have to use Form Customization.

      More info here: http://bobsguides.com/hiding-elements-in-the-manager.html


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.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
        • 36549
        • 572 Posts
        Ah i'd just got it the wrong way round. It all works as expected. Thank you very much for your help.

        The reason i mentioned the Form Customzation is that i usually uncheck the Templates option for all Templates so Editors can't mess anything up but in this case i needed to activate it for certain Templates so the dropdown displayed for my chosen resources.

        Thanks again.
          www.9thwave.co.uk
             WEB | DESIGN | PRINT
          • 3749
          • 24,544 Posts
          The rtfm page was not as clear as it could have been -- I've updated it.

          I'm glad you got it sorted. Thanks for the feedback. smiley


          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html [ed. note: BobRay last edited this post 14 years, 1 month ago.]
            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
            • 36549
            • 572 Posts
            Hi,

            Sorry to bring this up again but there appears to be an issue when adding templates within a category that is then added to 'Element Category access'. An Editor can no longer access TV's associated with any template placed in a 'restricted' category.
            Is there a work around to this?

            Thanks for any help
              www.9thwave.co.uk
                 WEB | DESIGN | PRINT
              • 3749
              • 24,544 Posts
              Do you mean they can't see the TVs when editing Resources, or they can't edit the TV objects (or both)?

              You should be able to put the TVs themselves in another category and give Editors access to that category with another Element Category Access ACL entry.


              ------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using.
              MODX info for everyone: http://bobsguides.com/modx.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
                • 36549
                • 572 Posts
                Hi BobRay,

                Thanks for looking at this.
                Editors can't see the TV's, they don't display, but as soon as i take the template out of the category the associated TV's display for them.
                So you're saying i need to put the tv's required for the editors in another category (a unique category to the TV's required by editors?) and then add this category to the Element Category Access for editors?
                I'll try that anyway and post results.

                thanks again...your help is much appreciated. [ed. note: 9thwave last edited this post 14 years ago.]
                  www.9thwave.co.uk
                     WEB | DESIGN | PRINT
                  • 36549
                  • 572 Posts
                  Nope, can't get it to work, sorry if i'm missing the obvious but this is new Revo territory for me.

                  So here's what i did....

                  • - I have a TV, let's call it 'TV-NUMBER1' associated with a template called Blank.
                  • - I do not want Editors to see this Blank template in their resources template dropdowns so I add this to a 'restricted' category. The restricted category has been added to the admin user groups Element Category Access with an Access Policy of Element. At this point the TV-NUMBER1 disappears from the editors resource (but it is still available to admins).
                  • - I then add TV-NUMBER1 to a new category called Editors-TVs and add this category to the editors user group Element Category Access with Min-Role of editors and Access Policy of Element. The TV-NUMBER1 is still not displaying for editors.
                    Also the category disappears from the admins Elements tree.

                  I'm a bit lost but am about to absorb myself in the MODX security chapter of The Official Guide book to see if it sheds any light.

                  In the meantime any help is much appreciated.

                  Cheers [ed. note: 9thwave last edited this post 14 years ago.]
                    www.9thwave.co.uk
                       WEB | DESIGN | PRINT
                    • 3749
                    • 24,544 Posts
                    First, did you flush permissions *and* all Sessions on the Security menu after making your changes?

                    Do you mean TV-NUMBER1 is not displaying in the Elements tree, or not displaying when editing a page? If the latter, is that TV attached to the Template of the page?

                    The category disappearing for the Admin is normal, because you've hidden it from yourself. To get it back you can either make yourself a sudo user or add yourself to the Editors group.


                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.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
                      • 36549
                      • 572 Posts
                      yep i do the flushing of permissions and sessions every time.

                      TV-NUMBER1 (it is attached to the template called Blank) is not displaying for the editors when i add the template Blank to the admins 'restricted' category..
                      I don't want editors to see the template called Blank but i do want them to still see the attached TV.

                      I want Editors to see only a select few templates so they can assign them to their documents and any Templates i don't want them to view in the dropdown i still want them to be able to view the attached TV's.
                      Another instance would be all the Articles templates...i don't want Editors to see these in the Templates dropdown but i do want them to be able to view the attached TV's.

                      Does that make sense?

                      Thanks
                        www.9thwave.co.uk
                           WEB | DESIGN | PRINT