erasor = $erasor; $this->acl = $acl; if ($this->acl->get('dataPrivacyPermission') === 'no') { throw new Forbidden(); } } public function postActionErase(Request $request, Response $response): void { $data = $request->getParsedBody(); if ( empty($data->entityType) || empty($data->id) || empty($data->fieldList) || !is_array($data->fieldList) ) { throw new BadRequest(); } $this->erasor->erase($data->entityType, $data->id, $data->fieldList); $response->writeBody('true'); } }