Skip to content

Commit

Permalink
[#4918] Limit save permission check to modified nodes in resource/sor…
Browse files Browse the repository at this point in the history
…t processor
  • Loading branch information
opengeek committed Jul 1, 2011
1 parent ac7de7d commit 2a8f673
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions core/docs/changelog.txt
Expand Up @@ -2,6 +2,7 @@
This file shows the changes in recent releases of MODX. The most current release is usually the
development release, and is only shown to give an idea of what's currently in the pipeline.

- [#4918] Limit save permission check to modified nodes in resource/sort processor
- [#5065] Fix 404 error with cross-context symlinks when cacheable
- [#5152] Fix nested non-cacheable tags from being cached in modResource->_content
- [#5145] Update config check on dashboard to show correct core path if core is moved
Expand Down
11 changes: 7 additions & 4 deletions core/model/modx/processors/resource/sort.php
Expand Up @@ -29,10 +29,6 @@
$node = $modx->getObject('modResource',$ar_node['id']);
if (empty($node)) continue;

if (!$node->checkPolicy('save')) {
$nodeErrors[] = $modx->lexicon('access_denied');
continue;
}
if (empty($ar_node['context'])) continue;
if (in_array($ar_node['parent'],$dontChangeParents)) continue;

Expand Down Expand Up @@ -76,6 +72,13 @@
$node->set('menuindex',$ar_node['order']);
$modifiedNodes[] = $node;
}
if (!empty($modifiedNodes)) {
foreach ($modifiedNodes as $modifiedNode) {
if (!$modifiedNode->checkPolicy('save')) {
$nodeErrors[] = $modx->lexicon('resource_err_save');
}
}
}
if (!empty($nodeErrors)) {
return $modx->error->failure(implode("\n", array_unique($nodeErrors)));
}
Expand Down

0 comments on commit 2a8f673

Please sign in to comment.