We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46886
    • 1,154 Posts
    Thank you Bruno. I was a bit shocked at the negative answer haha, and that got me thinking about it. The way the question was structured, the answer was just no.

    But obviously the proper data can be provided if one is willing to go outside the manager. Inside the manager may also be possible, but its a lot trickier.
    • That's a good one, Bruno17! It's going in the Cookbook right now.

      You could easily enough modify that, either hard-coded or in its configuration to limit to any group or set of groups.

      And a single line excludes Sudo users from this limitation:
      if ($modx->user->get('sudo')) { return; }


      I'll bet you could do much the same thing to show/hide the Sudo checkbox, only showing it to other Sudo users. Either add some CSS to hide it, or some Javascript to completely remove it.
      [ed. note: sottwell last edited this post 8 years, 3 months ago.]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 41787
        • 8 Posts
        Thank you for your answers! It is perfect!
          • 5430
          • 247 Posts
          Quote from: Bruno17 at Dec 01, 2015, 11:59 PM
          at least, you can restrict the listing in the grid to users in the primarygroup only of the current user with a plugin

          if ($modx->context->get('key') == "mgr") {
          
              switch ($modx->event->name) {
          
                  case 'OnMODXInit':
          
          
                      $action = $modx->getOption('action', $_REQUEST, '');
                      if ($action == 'security/user/getList') {
          
                          $group = $modx->user->getPrimaryGroup();
          
          
                          $_POST['usergroup'] = $group->get('id');
                          
                      }
                      break;
          
          
              }
          
          }
          return;

          This is super useful. Is it possible to populate the dropdown user group filter to show multiple groups if the user is a member of more than one group? And/or simply display all the users in all the groups the current user is a part of?