entityManager->getRDBRepositoryByClass(Report::class)->getNew(); unset($data->isInternal); $attributeList = [ 'entityType', 'type', 'data', 'columns', 'groupBy', 'orderBy', 'orderByList', 'filters', 'filtersDataList', 'runtimeFilters', 'filtersData', 'columnsData', 'chartColors', 'chartDataList', 'chartOneColumns', 'chartOneY2Columns', 'chartType', 'joinedReports', 'joinedReportLabel', 'joinedReportDataList', ]; foreach (array_keys(get_object_vars($data)) as $attribute) { if (!in_array($attribute, $attributeList)) { unset($data->$attribute); } } $report->setMultiple($data); $report->setApplyAcl(); $report->setName('Unnamed'); $this->serviceContainer->getByClass(Report::class)->processValidation($report, $data); foreach ($report->getJoinedReportIdList() as $subReportId) { $subReport = $this->entityManager->getRDBRepositoryByClass(Report::class)->getById($subReportId); if (!$subReport) { continue; } $this->reportHelper->checkReportCanBeRun($subReport); if (!$this->acl->checkEntityRead($subReport)) { throw new Forbidden("No access to sub-report."); } } $this->reportHelper->checkReportCanBeRun($report); if ( $report->getTargetEntityType() && !$this->acl->checkScope($report->getTargetEntityType(), AclTable::ACTION_READ) ) { throw new Forbidden("No 'read' access to target entity."); } return $report; } }