-
Task
-
Resolution: Done
-
Undefined
-
None
-
None
-
None
If the user with not enough permission for the resource attempts to send a export request for the resource. An exception occurs in the logs
[level=ERROR] [category=org.candlepin.subscriptions.export.ExportSubscriptionListener] - Error thrown for event: 'f8c5fae4-6ebc-417d-a494-13fc6eeb604e' sending ErrorRequest: 'Insufficient permission'
This card is to modify the exception to return true or false
With discussion with jcarvaja@redhat.com suggestion was to change the current from,
checkRbac(request);
uploadData(exporterService, request);
log.info(
"Event processed: '{}' from application: '{}'",
request.getId(),
request.getSource());
to
if (checkRbac(request)) {
uploadData(exporterService, request);
log.info(
"Event processed: '{}' from application: '{}'",
request.getId(),
request.getSource());
} else {
exportApi.downloadExportError(
request.getExportRequestUUID(),
request.getApplication(),
request.getRequest().getUUID(),
new DownloadExportErrorRequest().error(xxx).message("missing permissions or something like this"));
}
Related discussion: https://redhat-internal.slack.com/archives/C04K9MVQ9R9/p1718088910363549