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

    I’d like to isolate permissions for a user to enable them to only edit Template Variables. They should not be able to create new Resources or make any edits other than to the content of TVs.

    I have linked to a screencap showing what my current login screen looks like for the client. I’d like the tabs that are highlighted in red not to appear for the client, so that they can’t access any of the settings within them.

    Also, if the client were to select ’Quick Edit’ from the left nav menu I think they would still have access to some information that they really shouldn’t. Can I remove the ability to ’Quick Edit’?

    Screencap:

    http://min.us/mveTVQa

    Thanks!
      • 3749
      • 24,544 Posts
      I’m not sure about QuickEdit, but I don’t think there’s any way to use permissions to allow users to edit TVs without permission to edit and save the document they’re attached to. Unless you mean editing the TV itself, independent of any Resource. They could only set the TV type, name, default value etc. but not the value for any resource. You might be able to do it with form customization by hiding all resource fields and the other tabs, but it would be a pain to set up.

      Another way to go: I just uploaded the NewsPublisher package and it may be available for download in a day or so. It would allow you to very easily present a form in the front end that only showed the TV’s you want them to be able to edit. It will also show some of the other fields if you like (e.g., pagetitle), but as read only. They would have to log in and have the correct Context Access permissions in order to access the form.
        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
        • 31981
        • 26 Posts
        That sounds like a great solution - any idea when/how I would be able to download that?
          • 3749
          • 24,544 Posts
          Quote from: wassailant at Jan 06, 2011, 02:45 PM

          That sounds like a great solution - any idea when/how I would be able to download that?

          It should show up in the Repo (don’t know why it doesn’t) when you click on the "Download "Extras" button in Package Manager.

          Instead, you can try this:

          https://github.com/BobRay/newspublisher

          Click on the Downloads button.

          Download the package to your core/packages directory

          Go to Package Manager

          Click on "Add Package" and "Search Locally for Packages."

          NewsPublisher should appear in the grid. Just click on install.

          Look here for info in using it: http://bobsguides.com/newspublisher-tutorial.html

          Let me know if you have any trouble with that installation process.
            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
            • 31981
            • 26 Posts
            Hi BobRay,

            I have installed NewsPublisher and it seems to be almost working.

            I am having trouble getting NewsPublisher to work as per your instructions @ http://bobsguides.com/newspublisher-tutorial.html

            My site currently has a button that says ’In noShow list’, and when I click it the page refreshes.

            Is this a permissions issue? I tried adding ’allow_modx_tags’ to the Context Permissions list for the admin group as I thought that might have been the problem, but that hasn’t altered anything.

            When I go straight to the NewsPublisher page I created I see the error message ’Create/Edit Resource
            Sorry . . . There were one or more problems in producing the form:
            You do not have permission to edit resources containing modx tags.’

            I feel like I’m so close to solving this! Your help is very much appreciated.

            For reference, I have included my code below:
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            	"http://www.w3.org/TR/html4/strict.dtd">
            <html>
            <head>
            	<title>Felix The Cat</title>
                    <base href="[[++site_url]]" />
            	<meta http-equiv="Content-Type" content="text/html; charset=[(modx_charset)]" />
                    <link href="assets/templates/felix/styles/felix.css" rel="stylesheet" type="text/css" />
            
                    <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script>
            	<script type="text/javascript" src="http://dev.jquery.com/view/tags/ui/latest/ui/effects.core.js"></script>
            	<script type="text/javascript" src="http://dev.jquery.com/view/tags/ui/latest/ui/effects.slide.js"></script>
            	<script type="text/javascript" src="assets/templates/felix/styles/supersized.2.0.js"></script>
            	<script type="text/javascript">  
            		$(function(){
            			$.fn.supersized.options = {  
            				startwidth: 640,  
            				startheight: 480,
            				vertical_center: 1,
            				slideshow: 1,
            				navigation: 1,
            				transition: 1, //0-None, 1-Fade, 2-slide top, 3-slide right, 4-slide bottom, 5-slide left
            				pause_hover: 0,
            				slide_counter: 1,
            				slide_captions: 1,
            				slide_interval: 7000
            			};
            	        $('#supersize').supersized(); 
            	    });
            	</script>
                
                <script type="text/javascript">
            
              var _gaq = _gaq || [];
              _gaq.push(['_setAccount', 'UA-17031994-1']);
              _gaq.push(['_trackPageview']);
            
              (function() {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
              })();
            
            </script>
                
            </head>
            <body>
            
            	<!--Loading display while images load-->
            <div id="loading"> </div>
            
            <!--Slides-->
            <div id="supersize">
            	<div><img src="/felixthecat/modx//assets/templates/felix/images/felix1.jpg" title="Felix Bar Interior" alt="Felix Bar Interior"></div>
            	<div><img src="/felixthecat/modx/assets/templates/felix/images/felix2.jpg" title="Felix Bar Interior" alt="Felix Bar Interior"></div>
                <div><img src="/felixthecat/modx/assets/templates/felix/images/felix3.jpg" title="Felix Bar Interior" alt="Felix Bar Interior"></div>
                <div><img src="/felixthecat/modx/assets/templates/felix/images/felix4.jpg" title="Felix Bar Interior" alt="Felix Bar Interior"></div>
                <div><img src="/felixthecat/modx/assets/templates/felix/images/felix5.jpg" title="Felix Bar Interior" alt="Felix Bar Interior"></div>
                <div><img src="/felixthecat/modx/assets/templates/felix/images/felix6.jpg" title="Felix Bar Interior" alt="Felix Bar Interior"></div>
                <div><img src="/felixthecat/modx/assets/templates/felix/images/felix7.jpg" title="Felix Bar Interior" alt="Felix Bar Interior"></div>
                <div><img src="/felixthecat/modx/assets/templates/felix/images/felix8.jpg" title="Felix Bar Interior" alt="Felix Bar Interior"></div>
            </div>
            
            <div id="logo">
            	<a href="index.php?id=1"><img src="/felixthecat/modx/assets/templates/felix/images/felixlogo.png" title="Felix Logo"  alt="Felix Bar Logo"></a></div>
                
            <!-- NAVIGATION -->
            
            <div id="navigation">
                <ul id="navlist">
                <li class="button"><a href="javascript:void(0)" onClick="window.location.href='index.php?id=1'">HOME</a>
                <li class="button"><a href="javascript:void(0)" onClick="window.location.href='index.php?id=3'">FUNCTIONS</a>
                <li class="button"><a href="javascript:void(0)" onClick="window.location.href='index.php?id=4'">FOOD AND WINE</a>
                <li class="button"><a href="javascript:void(0)" onClick="window.location.href='index.php?id=5'">WHAT'S ON</a>
                <li class="button"><a href="javascript:void(0)" onClick="window.location.href='index.php?id=6'">CONTACT</a>		
                </ul>
            </div>
                        
            <div id="facebookpng" style="height: 45px">
                <a href="http://www.facebook.com/TheFelixBar" target="_blank"><img src="/felixthecat/modx/assets/templates/felix/images/facebookpng45.png" title="Facebook Link" alt="Felix Facebook Link"></a>
            </div>
                        
            <div id="twitterpng" style="height: 45px">
            	<a href="http://twitter.com/FelixBarComedy" target="_blank"><img src="/felixthecat/modx/assets/templates/felix/images/twitterpng45.png" title="Twitter Link" alt="Felix Twitter Link"></a>
            </div>
                     
            
            <!-- END NAVIGATION --> 
                 
            <!-- CONTENT -->
                    
            <div id="content">
            	<div class="contentframe">
                	<p><h1>WELCOME TO THE FELIX BAR</h1></p>
                    <br>
                    [[*Content]]
            	</div>
                
            <!-- CONTENT -->
            
            <!--NewsPublisher BUTTON-->
            
            [[!NpEditThisButton? &debug=`1`]]
            
            </body>
            </html>
              • 3749
              • 24,544 Posts
              If you don’t send the &noShow parameter, there are two pages where you will see that by default (meaning that the button would not ordinarily be shown): The home page, and the NewsPublisher page. If you preview any other document, it should show as Edit. Let me know if that’s not the case.
                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
                • 31981
                • 26 Posts
                Sorry if I seem a little dim but that doesn’t make any sense to me - I haven’t done anything relating to parameters at all. I have only tried to get the default install of NewsPublisher to allow me to edit my TVs.
                  • 3749
                  • 24,544 Posts
                  Try this. Remove the debug parameter from the NpEditThisButton tag in your template (but leave the tag).

                  On your NewsPublisher resource page, put this for the entire content:

                  [[!NewsPublisher? &show=`MyTv1,MyTv2,MyTv3`]]


                  Use the actual names of your TVs (or get the TV IDs from the Elements tree and do it like this:

                  [[!NewsPublisher? &show=`1,3,5`]]


                  Preview a resource you want to edit. Click on the edit button and you should end up on the NewsPublisher editing screen with just the TVs showing.
                    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
                    • 31981
                    • 26 Posts
                    Hi BobRay,

                    No luck unfortunately, it doesn’t seem to be working correctly.

                    When I removed
                    &debug=`1`
                    from the button tag and previewed all that happens is the button disappears.

                    If I go directly to the NewsPublisher page one of two things happens, depending on what template I use for this page.

                    If I use the base template it takes me to this screen:

                    http://min.us/mvfFZl4

                    If I have the index template selected then the button just disappears and nothing is clickable.

                    I’m starting to think form customisation might be easier? This NewsPublisher seems like it does not want me to get it working...
                      • 3749
                      • 24,544 Posts
                      OK, at least the snippet is running wink

                      Go to to System->System Settings, type default in the search box and click anywhere in the grid.

                      Set the value of hidemenu_default to Yes or No.

                      Check the value of the default_template and make sure it’s not 0. If it is, look in the template section of the Elements tab at the left and pick a default template. Put its number as the value of default_template and note the name.

                      Then, edit each TV and on the Template Access tab, make sure the system default template is checked.

                      That’s the template that will be used for new documents and it has to have those TVs attached.

                      For the button, edit the NpEditThisButton snippet and, on the properties tab, check the value of np_id. It should be set to the ID of the NewsPublisher Resource. It should show up on every page except for the home page and the NewsPublisher page (assuming that you’re previewing from the Manager).
                        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