hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2.05k stars 1.33k forks source link

Advanced Compartment authorization #6414

Open AlthafGit opened 4 weeks ago

AlthafGit commented 4 weeks ago

Actually I tried with to added the rule based on specific param in the builder as below. Its not working and allowed to give all categories.

AdditionalCompartmentSearchParameters params = new AdditionalCompartmentSearchParameters(); params.addSearchParameters("Condition:category=encounter-diagnosis");

                        builder.allow().read().resourcesOfType(requestResource).inCompartmentWithAdditionalSearchParams("Patient", userIdPatientId, params) // Allow only the specified category
                        .forTenantIds(accountId)
                        .andThen().denyAll().build();