云服务器内容精选

  • URI GET /v1/{project_id}/datasets/{dataset_id}/permissions 表1 路径参数 参数 是否必选 参数类型 描述 dataset_id 是 String 数据集ID。 project_id 是 String 项目ID。 获取方法请参考获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 permission_type 是 String 权限类别: ROW:行级权限;COLUMN:列级权限。 offset 是 Integer 偏移值。分页的偏移值,0代表不偏移,也就是第一页,1代表偏移1,指的第二页。 limit 是 Integer 返回列表数量。 sort_key 否 String 排序字段 isOpen,是否开启行列权限。 sort_dir 否 String 排序类别:desc、asc。desc代表减序,asc代表升序。
  • 响应示例 { "count" : 3, "page_data" : [ { "id" : "xxxxfdff-xxxb-xxxx-8f52-e15e35axxxxx", "name" : "COLUMN", "dataset_id" : "xxxxd682-e129-xxxx-ad8e-673f02xxxxxx", "is_open" : true, "permission_type" : "COLUMN", "rule_type" : "MASK", "rule_scope" : "ALL", "project_id" : "xxxx703a500dxxxxfb3c00f9fxxxxx", "workspace_Id" : "xxxx6703a50xxxxx2fb3c00f9fxxxxxx", "rule_user" : { "users" : [ ], "user_groups" : [ ] }, "rule_content" : { "last" : 1, "first" : 1, "mask_type" : "RETAIN_FIRST_N_LAST_M", "column_ids" : [ "xxxxe9d6-6xxx-4126-bxxx-36fcxxxxce54.amount" ], "special_words" : [ "xxx" ] }, "display_fields" : { "user_map" : { }, "group_map" : { }, "field_map" : { "xxxxe9d6-xxxe-4126-bd51-36fc0ee3ce54.amount" : "amount" } } }, { "id" : "xxxxda33-dace-xxxx-8xxx-c6dfaxxxxxf1", "name" : "USER_TAG", "dataset_id" : "xxxxxd13-cxxx-4xxx-b657-829axxxxx20e", "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-xxxx-4340-9b5d-0bd856xxxxxx" ], "value_type" : "TAG_USER_GROUP", "value_names" : [ "userGroup2" ] }, "column_id" : "xxxxx722-b74c-4xxx-9630-43ca65xxxxxx.buyer_name", "is_measure" : false, "column_name" : "buyer_name", "relation_operator" : "" }, "logic_operator" : null }, { "condition_node" : { "value" : { "values" : [ "xxxxx355-4ffa-xxxx-9b5d-0bd856xxxxx" ], "value_type" : "TAG_USER_GROUP", "value_names" : [ "userGroup2" ] }, "column_id" : "xxxxx22-b74c-4752-xxx0-xxxx65d0d12c.buyer_name", "is_measure" : false, "column_name" : "buyer_name", "relation_operator" : "" }, "logic_operator" : null } ] }, "display_fields" : null }, { "id" : " xxx14b04-ef3d-4ebc-a9ee-c651f563d67c", "name" : "测试", "dataset_id" : "xxxx4d13-c2a3-426f-b657-829addaxxxxx", "is_open" : true, "permission_type" : "ROW", "rule_type" : "BY_CONDITION", "rule_scope" : "SPECIFIED", "rule_user" : { "users" : [ "xxxxxxxed1b94534xxxxx3de304axxxx", "xxxx987b3dc4xxxx68b8dff1e7xxxxx", "774d5axxxxxb4950aabc8651308xxxxx" ], "user_groups" : [ ] }, "rule_content" : { "condition_node" : null, "logic_operator" : "AND", "sub_conditions" : [ { "condition_node" : { "value" : { "values" : [ "123" ], "value_type" : "CONDITION" }, "column_id" : "xxxx6722-b74c-4752-9xxx-43ca65d0d12xxxxx.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" : "xxxx722-b74c-4752-xxxx-43ca65dxxxxx.buyer_name", "is_measure" : false, "column_name" : "buyer_name", "relation_operator" : "CONTAIN" }, "logic_operator" : null } ] } ] }, "display_fields" : { "user_map" : { "xxxx987b3dc4xxxxxxb8dff1e73xxxx" : "auth_test", "xxxxxac55eeb4950axxxx6513080xxxx" : "chenxiantao", "xxxxx57ed1b9453xxxx943de304xxxxx" : "abac_test" }, "group_map" : { }, "field_map" : null } } ] }
  • 请求示例 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 } } ] }