I have an AJAX call to get a list of store objects. It works fine if I am logged in as admin but returns an empty list if logged in as any other type of member or not logged in at all.
any and all help most appreciated
public function getStoreList(){
if($this->isAjax) {
if( $data = DataObject::get('Store', 'DealerGroupID=' . $_REQUEST['DealerGroupID']) ){
$f1 = new JSONDataFormatter();
return $f1->convertDataObjectSet($data);
}else{
return '{"items": []}';
}
} else {
return '"items": []}';
}
}