How to create an access policy where the user can ...
# support
n
I'm trying to create an access policy where the user can only create appointsments and further more they have to be an actor in them. I'm trying to use FHIR expressions but not getting any luck { "resourceType": "Appointment", "writeConstraint": [ { "language": "text/fhirpath", "expression": "%before.exists().not() implies %profile in participant.actor" } ] }, Any ideas?
have also tried this { "resourceType": "Appointment", "writeConstraint": [ { "language": "text/fhirpath", "expression": "%before.exists().not() and participant.actor.reference.contains(%profile)" } ] } am I allowe to use %profile here? Any place I can find more advanced examples?
okay seems like %profile.id and %profile both work fine. { "resourceType": "Appointment", "writeConstraint": [ { "language": "text/fhirpath", "expression": "%before.exists().not() and %profile in %after.participant.actor.reference" } ] }, but now I'm getting Forbidden with this. Trying to make an appointment. %after.participant is an array, maybe that's why?
r
hi @noclip thanks for the question. We haven't had a chance to repro this, but at first glance I don't see anything obviously wrong with your approach
254 Views