{
  "type": "record",
  "name": "DataHubPolicyInfo",
  "namespace": "com.linkedin.pegasus2avro.policy",
  "doc": "Information about a DataHub (UI) access policy.",
  "fields": [
    {
      "name": "displayName",
      "type": "string",
      "doc": "Display name of the Policy",
      "Searchable": {
        "fieldType": "KEYWORD"
      }
    },
    {
      "name": "description",
      "type": "string",
      "doc": "Description of the Policy"
    },
    {
      "name": "type",
      "type": "string",
      "doc": "The type of policy"
    },
    {
      "name": "state",
      "type": "string",
      "doc": "The state of policy, ACTIVE or INACTIVE"
    },
    {
      "name": "resources",
      "type": [
        "null",
        {
          "type": "record",
          "name": "DataHubResourceFilter",
          "doc": "Information used to filter DataHub resource.",
          "fields": [
            {
              "name": "type",
              "type": [
                "null",
                "string"
              ],
              "doc": "The type of resource that the policy applies to. This will most often be a data asset entity name, for\nexample 'dataset'. It is not strictly required because in the future we will want to support filtering a resource\nby domain, as well.",
              "default": null,
              "deprecated": true
            },
            {
              "name": "resources",
              "type": [
                "null",
                {
                  "type": "array",
                  "items": "string"
                }
              ],
              "doc": "A specific set of resources to apply the policy to, e.g. asset urns",
              "default": null,
              "deprecated": true
            },
            {
              "name": "allResources",
              "type": "boolean",
              "doc": "Whether the policy should be applied to all assets matching the filter.",
              "default": false,
              "deprecated": true
            },
            {
              "name": "filter",
              "type": [
                "null",
                {
                  "type": "record",
                  "name": "PolicyMatchFilter",
                  "doc": "The filter for specifying the resource or actor to apply privileges to",
                  "fields": [
                    {
                      "name": "criteria",
                      "type": {
                        "type": "array",
                        "items": {
                          "type": "record",
                          "name": "PolicyMatchCriterion",
                          "doc": "A criterion for matching a field with given value",
                          "fields": [
                            {
                              "name": "field",
                              "type": "string",
                              "doc": "The name of the field that the criterion refers to"
                            },
                            {
                              "name": "values",
                              "type": {
                                "type": "array",
                                "items": "string"
                              },
                              "doc": "Values. Matches criterion if any one of the values matches condition (OR-relationship)"
                            },
                            {
                              "name": "condition",
                              "type": {
                                "type": "enum",
                                "name": "PolicyMatchCondition",
                                "doc": "The matching condition in a filter criterion",
                                "symbols": [
                                  "EQUALS"
                                ],
                                "symbolDocs": {
                                  "EQUALS": "Whether the field matches the value"
                                }
                              },
                              "doc": "The condition for the criterion",
                              "default": "EQUALS"
                            }
                          ]
                        }
                      },
                      "doc": "A list of criteria to apply conjunctively (so all criteria must pass)"
                    }
                  ]
                }
              ],
              "doc": "Filter to apply privileges to",
              "default": null
            }
          ]
        }
      ],
      "doc": "The resource that the policy applies to. Not required for some 'Platform' privileges.",
      "default": null
    },
    {
      "name": "privileges",
      "type": {
        "type": "array",
        "items": "string"
      },
      "doc": "The privileges that the policy grants."
    },
    {
      "name": "actors",
      "type": {
        "type": "record",
        "name": "DataHubActorFilter",
        "doc": "Information used to filter DataHub actors.",
        "fields": [
          {
            "name": "users",
            "type": [
              "null",
              {
                "type": "array",
                "items": "string"
              }
            ],
            "doc": "A specific set of users to apply the policy to (disjunctive)",
            "default": null
          },
          {
            "name": "groups",
            "type": [
              "null",
              {
                "type": "array",
                "items": "string"
              }
            ],
            "doc": "A specific set of groups to apply the policy to (disjunctive)",
            "default": null
          },
          {
            "name": "resourceOwners",
            "type": "boolean",
            "doc": "Whether the filter should return true for owners of a particular resource.\nOnly applies to policies of type 'Metadata', which have a resource associated with them.",
            "default": false
          },
          {
            "name": "allUsers",
            "type": "boolean",
            "doc": "Whether the filter should apply to all users.",
            "default": false
          },
          {
            "name": "allGroups",
            "type": "boolean",
            "doc": "Whether the filter should apply to all groups.",
            "default": false
          }
        ]
      },
      "doc": "The actors that the policy applies to."
    },
    {
      "name": "editable",
      "type": "boolean",
      "doc": "Whether the policy should be editable via the UI",
      "default": true
    },
    {
      "name": "lastUpdatedTimestamp",
      "type": [
        "null",
        "long"
      ],
      "doc": "Timestamp when the policy was last updated",
      "default": null,
      "Searchable": {
        "fieldType": "DATETIME"
      }
    }
  ],
  "Aspect": {
    "name": "dataHubPolicyInfo"
  }
}