We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    This is an old thread, but for people who find it -- the solution to getting changes to apply immediately for the current user is to clear the user's attributes with code like this:

    $userId = $modx->user->get('id');
    unset($_SESSION["modx.user.{$userId}.userGroups"]);
    $context = 'web';
    $targets = explode(',', $modx->getOption('principal_targets', null,
    'modAccessContext,modAccessResourceGroup,modAccessCategory,sources.modAccessMediaSource'));
    array_walk($targets, 'trim');
    $modx->user->loadAttributes($targets, $context, true);


      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