We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11105
    • 5 Posts
    Hi,
    I have built a fairly simple employee directory component for modx and I have created a section for it in the manager menu which I want to secure with permissions.
    I have read through the documentation and watched Shauns video so I think I am familiar with the way permissions work in modx.
    What I have tried to do is add a permission to the modx manager menu item and assign that permission to a policy (to begin with I was going to add it to the administration policy).
    So what I tried was :
    Added ’employeedirectory’ permission to the component menu (I have a menu called EmployeeDirectory in the admin with my custom component actions under it).
    When I look for the permission in Policy Templates it is not in the list. Is there somewhere else to map permissions to custom actions ?

    Any help on this would be very much appreciated smiley

    edit:
    I Forgot to say the aim is to allow certain users to add different parts of the directory. So someone will enter the employees in the directory. Someone else will fill out their locations or the sites they work on etc.etc.
    I would like to lock these down to seperate permissions if thats possible.
      • 22019
      • 390 Posts
      Have a look at the way quip handles permissions - that has component-menu based permissions - quip creates new permissions on install, as well as new menu, action items.

      Create a duplicate of the Administrator Policy Template (revo 2.0.5) and add your new permission to the policy template. Then create or duplicate an access policy that uses that template. Use that permission in the permissions box on the action in the menu item. You then need to write some code to action something based on the permission (in quip this is often the first line of a controller).

      There’s also a helpful guy on Youtube who has posted a video on hiding elements of the menu tab, which is pretty much what you want (but for 2.0.4) : http://www.youtube.com/user/bridgecourtinc#p/u/1/ZAGYQjwie0A
        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • 11105
        • 5 Posts
        Okay cheers,
        I had been looking at quip as a template for how to make my component.
        I hadnt got the install bit done yet so i have been developing inline sort of.

        Cheers.