{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "cerbos:///shared_resource.json",
    "title": "Generic schema describing a resource that is owned by exactly one identity, and shared with multiple tenants or shared with multiple identities.",
    "type": "object",
    "properties": {
        "identity_uuid": {
            "type": "string"
        },
        "shared_with_identities": {
            "type": "array",
            "items": [
              {
                "type": "string"
              }
            ]
        },
        "shared_with_tenants": {
            "type": "array",
            "items": [
              {
                "allOf": [{ "$ref": "cerbos:///tenant.json" }],
                "required": ["tenant_uuid"]
              }
            ]
        }
    },
    "anyOf":[
      {"required": ["identity_uuid"]},
      {"required": ["shared_with_identities"]},
      {"required": ["shared_with_tenants"]}
    ]
}
