Permalink
Browse files

BUG JSONDataFormatter should respect canView() permissions

  • Loading branch information...
1 parent 7a7c1a6 commit aff28eb896076069d429381e6ab0f453550f7579 @halkyon halkyon committed Nov 5, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 api/JSONDataFormatter.php
@@ -135,7 +135,10 @@ public function convertDataObjectToJSONObject(DataObjectInterface $obj, $fields
*/
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,

0 comments on commit aff28eb

Please sign in to comment.