serviceFactory = $serviceFactory; $this->acl = $acl; if ($this->acl->get('dataPrivacyPermission') === 'no') { throw new Forbidden(); } } public function postActionErase($params, \StdClass $data) { if (empty($data->entityType) || empty($data->id) || empty($data->fieldList) || !is_array($data->fieldList)) { throw new BadRequest(); } return $this->serviceFactory->create('DataPrivacy')->erase($data->entityType, $data->id, $data->fieldList); } }