Skip to content
Open
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,25 @@ class ReportsSchedulerExtension : ResourceSharingExtension {
object : ResourceProvider {
override fun resourceType(): String = Utils.REPORT_INSTANCE_TYPE
override fun resourceIndexName(): String = ReportInstancesIndex.REPORT_INSTANCES_INDEX_NAME

// Report instances are child resources of the report definition
// they were generated from: access is inherited from the parent
// definition's sharing record. This also covers instances created
// without an authenticated user in context (on-demand runs under
// the plugin subject; scheduled runs under job-scheduler).
override fun parentType(): String = Utils.REPORT_DEFINITION_TYPE
override fun parentIdField(): String = PARENT_ID_FIELD
}
)
}

companion object {
// Flattened field in the report instance document that holds the id of
// the report definition it was generated from. Indexed as keyword in
// report-instances-mapping.yml.
private const val PARENT_ID_FIELD = "reportDefinitionDetails.id"
}

override fun assignResourceSharingClient(resourceSharingClient: ResourceSharingClient?) {
ResourceSharingClientAccessor.getInstance()
.setResourceSharingClient(resourceSharingClient)
Expand Down
Loading