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

    I am able to use Notify in mgr as a member of the Administrator group. When I click on the [Launch Notify] button, it opens up this page [socotango.org/notify/], with the appropriate default values.

    However, I have a 'Content Editors' group, and I would like to also give the members of that group access to run Notify. The 'Content Editors' group has been given appropriate access to the Resource group 'ContentAdminResGroup', and the 'Notify' Resources are in that Resource group.

    When a 'Content Editors' user is logged in to mgr, and they click on the [Launch Notify] button, nothing happens. If I paste this value [socotango.org/notify/] in a new window (same browser), it gives this error message:
    Check the appropriate boxes and submit the following form to send notifications:
    (test_contentadmin) Unauthorized Access -- must be a member of Administrator group 


    Is there a way to allow members of another group in addition to Administrator to use Notify?

    Thanks,

    Karl Forsyth
      • 3749
      • 24,544 Posts
      It's kind of dumb about that at present. I think it would work to change the code at line 39 of the snippet:

      if (!$modx->user->isMember('Administrator') && (php_sapi_name() !== 'cli')) {
          return '(' . $modx->user->get('username') . ') ' . $modx->lexicon('nf.unauthorized_access');
      }


      to:

      if (!$modx->user->isMember(array('Administrator','someOtherGroup')) && (php_sapi_name() !== 'cli')) {
          return '(' . $modx->user->get('username') . ') ' . $modx->lexicon('nf.unauthorized_access');
      }


      This may be overwritten if you upgrade Notify unless you duplicate the snippet and set the property that identifies it (can't remember the details), but see if it works first.
        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