Skip to content

AuthorizationInterceptor no longer works on response of $document operation #6258

@gijsbert802

Description

@gijsbert802

Describe the bug
Starting with HAPI 7.4.0, the AuthorizationInterceptor seem to apply it's rules to the Bundle resource created by a $document operation instead of the resources contained in the response Bundle.
I believe this may be a regression caused by Fix authorization handling for Bundle resources in the output #5953 (@codeforgreen)

I don't quite understand how it works, but AuthorizationInterceptor#shouldExamineBundleChildResources now returns false when the resource is not an instance of IBaseParameters or IBaseBundle. Previously, it returned true in the case of a $document operation on Composition.

To Reproduce
I use these rules:

ruleBuilder
  .allow().operation().named("\$document").onInstance(resourceIdType).andRequireExplicitResponseAuthorization().andThen()
  .allow().read().instance(resourceIdType)
  .build()

Expected behavior
I expect the rules to be applied to the resources contained in the response Bundle, not to the Bundle itself.

Environment (please complete the following information):

  • HAPI FHIR Version 7.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions