We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38415 ☆ A M B ☆
    • 70 Posts
    christianseel Reply #1, 11 years ago
    Hey, I need to get a list of all contexts and their context settings without paying attation to the permissions of the current user.

    I'm aware that I can use
    $query = $this->modx->newQuery('modContext');
    $this->modx->getCollectionGraph('modContext', '{"ContextSettings":{}}', $query);

    to get all contexts and their settings, however getCollectionGraph respects the ACLs. So if I'm calling this in a snippet with a restricted user and a sudo user I'm getting different results.

    I need to build a full list without paying attation to the ACLs. I know that this could work with a pure xpdo query, but I'm unable to get it working (after hours). Can anybody help?
      chsmedien - Digital Marketing Agency
      MODX Professional & Ambassador

      http://chsmedien.com | http://twitter.com/christianseel
      • 3749
      • 24,544 Posts
      AFAIK, getCollectionGraph() doesn't do any permission checking at all. The processors do, but low-level xPDO get*() calls never do. I think you must be seeing some artifact of the way you're testing or displaying the results.
        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