Hey guys, need help I created access policies usi...
# dev
v
Hey guys, need help I created access policies using "Parameterized Policies (Beta)" Here is my policy:
Copy code
{
  "resourceType": "AccessPolicy",
  "name": "admin_patient_access_policy",
  "id": "ca8a5fb7-54e3-4abd-8677-556dae4bac8e",
  "compartment": {
    "reference": "%patient"
  },
  "resource": [
    {
      "resourceType": "Organization",
      "criteria": "Organization?_id=%provider_organization",
      "readonly": false
    }
  ]
}
I also added "access" to membership of the user
Copy code
"access": [
    {
      "policy": {
        "reference": "AccessPolicy/ca8a5fb7-54e3-4abd-8677-556dae4bac8e"
      },
      "parameter": [
        {
          "name": "provider_organization",
          "valueReference": {
            "reference": "Organization/c2c24e98-6df0-469c-961b-e352913aea2f"
          }
        }
      ]
    }
  ]
It's working perfectly for GET operation, but for PUT it gives 403 forbidden error (Im using low level api) ( Readonly is false by default, also I tried with "readonly":false ) UPDATE Type of the parameter is valueReference in "access". It should have been replaced with string. It resolved issues👍
Copy code
"access": [
    {
      "policy": {
        "reference": "AccessPolicy/ca8a5fb7-54e3-4abd-8677-556dae4bac8e"
      },
      "parameter": [
        {
          "name": "provider_organization",
          "valueString": "c2c24e98-6df0-469c-961b-e352913aea2f" 
        }
      ]
    }
  ]
159 Views