mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG JSONDataFormatter should respect canView() permissions
This commit is contained in:
parent
7a7c1a6857
commit
aff28eb896
@ -135,7 +135,10 @@ class JSONDataFormatter extends DataFormatter {
|
||||
*/
|
||||
public function convertDataObjectSet(SS_List $set, $fields = null) {
|
||||
$items = array();
|
||||
foreach ($set as $do) $items[] = $this->convertDataObjectToJSONObject($do, $fields);
|
||||
foreach($set as $do) {
|
||||
if(!$do->canView()) continue;
|
||||
$items[] = $this->convertDataObjectToJSONObject($do, $fields);
|
||||
}
|
||||
|
||||
$serobj = ArrayData::array_to_object(array(
|
||||
"totalSize" => (is_numeric($this->totalSize)) ? $this->totalSize : null,
|
||||
|
Loading…
Reference in New Issue
Block a user