Redaction of documents based on claim-level permissions
We can redact documents based on claim-level permissions so that users who do not have access to full document can still get some claims in the document (if they have access to any claim).
We can do it in the following way:
- If the user does not have access to a claim and any of it sub-claims, we remove it.
- If the user has access to a claim, we keep it. Recursively look at sub-claims.
- If the user does not have access to a claim but does have access to some sub-claims, we map the claim to unknown value claim and recurse for sub-claims.