Skip to main content

Redaction Policy

A redaction policy variable contains a list of master data fields that are hidden from some users

Introduction​

Redaction Policy variables are used to remove sensitive fields, such as prices or internal notes, from master data records before they are returned to the policy's members. The rest of the record is still returned.

Redaction applies to master data (the object service) when records are read, listed or searched. Members cannot filter, search, sort, group or aggregate on redacted fields. For how redaction works and more examples, see Redaction Policies.

Defining a Redaction Policy​

Below is a table with all the properties of a redaction policy:

NameTypeExampleDescription
_idStringHideContractPricingThe unique id for this policy
categoryStringTeamUsersAn optional category used for filtering policies
descriptionStringHide contract pricingA descriptive name for the policy
enabledBooleantrueTrue if it is enabled, false to disable it, by default the policy is enabled
membersListuser@company.comThe user emails or policy user groups this policy applies to, or * for everyone
redactionsList["contract.price"]The fields to remove, using dot notation for a field inside a property

A redaction policy has no allow or deny: its fields are always removed for its members.

Methods​

A redaction policy has the following methods:

NameDescriptionReturn Type
addMember(name)Adds a member to this policyvoid
removeMember(name)Removes a member from this policyvoid
addFieldRedaction(name)Adds a field to redactvoid

Example redaction policy definition:

{
"_id": "HideContractPricing",
"_type": "RedactionPolicy",
"category": "TradingTeam",
"description": "Analysts do not see contract pricing",
"redactions": [
"contract.price",
"contract.currency"
],
"members": [
"user:security:policy:Analysts"
],
"enabled": true
}

Updating, Finding and Deleting Redaction Policies​

Saving a redaction policy​

To save a redaction policy in OpenDataDSL code, use the save command as follows:

HideContractPricing = RedactionPolicy()
HideContractPricing.description = "Analysts do not see contract pricing"
HideContractPricing.addFieldRedaction("contract.price")
HideContractPricing.addFieldRedaction("contract.currency")
HideContractPricing.addMember("user:security:policy:Analysts")
save HideContractPricing

Listing redaction policies​

To find redaction policies, you use the ODSL find command, e.g.

policies = find ${policy} where _type="RedactionPolicy"

Retrieving a specific redaction policy​

To get a specific named redaction policy, you use the policy active variable, e.g.

p = ${policy:"HideContractPricing"}
print p.redactions

Disabling a redaction policy​

You can disable a redaction policy by setting the enabled flag to false, e.g.

p = ${policy:"HideContractPricing"}
p.enabled = false
save p

Deleting a redaction policy​

To delete a redaction policy, you issue the delete command, e.g.

delete ${policy:"HideContractPricing"}