mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Enforcing can*() in CampaignAdmin reads
This commit is contained in:
parent
783d45cedd
commit
a1ea239c8f
@ -240,6 +240,10 @@ JSON;
|
||||
'_embedded' => ['ChangeSetItems' => []]
|
||||
];
|
||||
foreach($changeSet->Changes() as $changeSetItem) {
|
||||
if(!$changeSetItem) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @var ChangesetItem $changeSetItem */
|
||||
$resource = $this->getChangeSetItemResource($changeSetItem);
|
||||
$hal['_embedded']['ChangeSetItems'][] = $resource;
|
||||
@ -294,7 +298,10 @@ JSON;
|
||||
*/
|
||||
protected function getListItems() {
|
||||
return ChangeSet::get()
|
||||
->filter('State', ChangeSet::STATE_OPEN);
|
||||
->filter('State', ChangeSet::STATE_OPEN)
|
||||
->filterByCallback(function($item) {
|
||||
return ($item->canView());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user