BUG JSONDataFormatter should respect canView() permissions

This commit is contained in:
Sean Harvey 2012-11-05 14:03:39 +13:00
parent 7a7c1a6857
commit aff28eb896

View File

@ -135,7 +135,10 @@ class JSONDataFormatter extends DataFormatter {
*/ */
public function convertDataObjectSet(SS_List $set, $fields = null) { public function convertDataObjectSet(SS_List $set, $fields = null) {
$items = array(); $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( $serobj = ArrayData::array_to_object(array(
"totalSize" => (is_numeric($this->totalSize)) ? $this->totalSize : null, "totalSize" => (is_numeric($this->totalSize)) ? $this->totalSize : null,