Use new API $modx->checkPermissions()