From aff28eb896076069d429381e6ab0f453550f7579 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 5 Nov 2012 14:03:39 +1300 Subject: [PATCH] BUG JSONDataFormatter should respect canView() permissions --- api/JSONDataFormatter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/JSONDataFormatter.php b/api/JSONDataFormatter.php index f2ce27341..638c36a24 100644 --- a/api/JSONDataFormatter.php +++ b/api/JSONDataFormatter.php @@ -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,