智能数据洞察 DATAARTS INSIGHT-配置数据集权限:请求示例

时间:2024-05-16 16:18:23

请求示例

POST https://{endpoint}/v1/{project_id}/datasets/{dataset_id}/permissions

{
  " dataset_permissions " : [ {
    "id" : "xxxxfdff-xxxx-43cb-8f52-e15e35axxxxx",
    "name" : "COLUMN",
    "dataset_id" : "1e27d682-xxxx-4589-ad8e-673f02d395f4",
    "is_open" : true,
    "permission_type" : "COLUMN",
    "rule_type" : "MASK",
    "rule_scope" : "ALL",
    "project_id" : "xxxx6703a500xxxx2fb3c00f9fxxxxxx",
    "workspace_Id" : "xxxx6703a50xxxxx2fb3c00f9fxxxxxx",
    "rule_user" : {
      "users" : [ ],
      "user_groups" : [ ]
    },
    "rule_content" : {
      "last" : 1,
      "first" : 1,
      "mask_type" : "RETAIN_FIRST_N_LAST_M",
      "column_ids" : [ "xxxxx9d6-6dae-xxxx-bd51-36fc0exxxxxx.amount" ],
      "special_words" : [ "xxx" ]
    },
    "display_fields" : {
      "user_map" : { },
      "group_map" : { },
      "field_map" : {
        "xxxxx9d6-6dae-4126-xxxx-36fc0exxxxxx.amount" : "amount"
      }
    }
  }, {
    "id" : "xxxxxa33-dace-xxxx-8ddf-c6dfa48xxxxx",
    "name" : "USER_TAG",
    "dataset_id" : "xxxx4d13-c2a3-xxxx-b657-829addaxxxxx",
    "is_open" : true,
    "permission_type" : "ROW",
    "rule_type" : "BY_TAG",
    "rule_scope" : "ALL",
    "rule_user" : {
      "users" : [ ],
      "user_groups" : [ ]
    },
    "rule_content" : {
      "condition_node" : null,
      "logic_operator" : "AND",
      "sub_conditions" : [ {
        "condition_node" : {
          "value" : {
            "values" : [ "xxxx3355-4ffa-xxxx-9b5d-0bd85668xxxx" ],
            "value_type" : "TAG_USER_GROUP",
            "value_names" : [ "userGroup2" ]
          },
          "column_id" : "xxxx6722-b74c-xxxx-9630-43ca65xxxxxx.buyer_name",
          "is_measure" : false,
          "column_name" : "buyer_name",
          "relation_operator" : ""
        },
        "logic_operator" : null
      }, {
        "condition_node" : {
          "value" : {
            "values" : [ "xxxxx355-4ffa-4340-9b5d-0bd856xxxxx" ],
            "value_type" : "TAG_USER_GROUP",
            "value_names" : [ "userGroup2" ]
          },
          "column_id" : "xxxxx722-b74c-4752-xxxx-43ca65dxxxxx.buyer_name",
          "is_measure" : false,
          "column_name" : "buyer_name",
          "relation_operator" : ""
        },
        "logic_operator" : null
      } ]
    },
    "display_fields" : null
  }, {
    "id" : "xxxxxb04-ef3d-4ebc-a9ee-c651f5xxxxxx",
    "name" : "测试",
    "dataset_id" : "xxxxxd13-c2a3-426f-xxxx-xxxxxdaba20e",
    "is_open" : true,
    "permission_type" : "ROW",
    "rule_type" : "BY_CONDITION",
    "rule_scope" : "SPECIFIED",
    "rule_user" : {
      "users" : [ "xxxxx57ed1b9453xxxxx43de304xxxxx", "xxxxx987b3dcxxxxb68b8dff1e7xxxxx", "xxxxxac55eeb4950aabc86513080f9ba" ],
      "user_groups" : [ ]
    },
    "rule_content" : {
      "condition_node" : null,
      "logic_operator" : "AND",
      "sub_conditions" : [ {
        "condition_node" : {
          "value" : {
            "values" : [ "123" ],
            "value_type" : "CONDITION"
          },
          "column_id" : "xxxx6722-b74c-xxxx-9630-43ca65dxxxxx.buyer_name",
          "is_measure" : false,
          "column_name" : "buyer_name",
          "relation_operator" : "CONTAIN"
        },
        "logic_operator" : null
      }, {
        "condition_node" : null,
        "logic_operator" : "OR",
        "sub_conditions" : [ {
          "condition_node" : {
            "value" : {
              "values" : [ "qwe" ],
              "value_type" : "CONDITION"
            },
            "column_id" : "xxxxx722-b74c-xxxx-9630-43ca65dxxxxx.buyer_name",
            "is_measure" : false,
            "column_name" : "buyer_name",
            "relation_operator" : "CONTAIN"
          },
          "logic_operator" : null
        } ]
      } ]
    },
    "display_fields" : {
      "user_map" : {
        "xxxxx987b3dc4xxxx68b8dff1exxxxxx" : "auth_test",
        "xxxxxac55eeb4xxxxabc865130xxxxxx" : "chenxiantao",
        "xxxxx57ed1b94xxxx6c943de30xxxxxx" : "abac_test"
      },
      "group_map" : { },
      "field_map" : null
    }
  } ]
}
support.huaweicloud.com/api-dataartsinsight/CreateAndUpdatePermission.html