Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3400 bulk export rules incorrectly applied to group and patient exports #3403

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
export rules are applied now
  • Loading branch information
olivia-you committed Feb 17, 2022
commit 971649117110d93483f31566ecb7f6e1ac481858
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public AuthorizationInterceptor.Verdict applyRule(RestOperationTypeEnum theOpera
}
for (String next : options.getResourceTypes()) {
if (!myResourceTypes.contains(next)) {
return null;
return new AuthorizationInterceptor.Verdict(PolicyEnum.DENY,this);
}
}
}
Expand All @@ -80,6 +80,8 @@ public AuthorizationInterceptor.Verdict applyRule(RestOperationTypeEnum theOpera
String actualGroupId = options.getGroupId().toUnqualifiedVersionless().getValue();
if (Objects.equals(expectedGroupId, actualGroupId)) {
return newVerdict(theOperation, theRequestDetails, theInputResource, theInputResourceId, theOutputResource);
} else {
return new AuthorizationInterceptor.Verdict(PolicyEnum.DENY,this);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void groupExport(
validatePreferAsyncHeader(theRequestDetails);
BulkDataExportOptions bulkDataExportOptions = buildGroupBulkExportOptions(theOutputFormat, theType, theSince, theTypeFilter, theIdParam, theMdm);
validateResourceTypesAllContainPatientSearchParams(bulkDataExportOptions.getResourceTypes());
IBulkDataExportSvc.JobInfo outcome = myBulkDataExportSvc.submitJob(bulkDataExportOptions, shouldUseCache(theRequestDetails), null);
IBulkDataExportSvc.JobInfo outcome = myBulkDataExportSvc.submitJob(bulkDataExportOptions, shouldUseCache(theRequestDetails), theRequestDetails);
writePollingLocationToResponseHeaders(theRequestDetails, outcome);
}

Expand Down Expand Up @@ -158,7 +158,7 @@ public void patientExport(
validatePreferAsyncHeader(theRequestDetails);
BulkDataExportOptions bulkDataExportOptions = buildPatientBulkExportOptions(theOutputFormat, theType, theSince, theTypeFilter);
validateResourceTypesAllContainPatientSearchParams(bulkDataExportOptions.getResourceTypes());
IBulkDataExportSvc.JobInfo outcome = myBulkDataExportSvc.submitJob(bulkDataExportOptions, shouldUseCache(theRequestDetails), null);
IBulkDataExportSvc.JobInfo outcome = myBulkDataExportSvc.submitJob(bulkDataExportOptions, shouldUseCache(theRequestDetails), theRequestDetails);
writePollingLocationToResponseHeaders(theRequestDetails, outcome);
}

Expand Down