Skip to content

Commit

Permalink
Data RBAC requires scope_info eq None.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 666441142
  • Loading branch information
dandye authored and copybara-github committed Aug 23, 2024
1 parent 40aaa3c commit f27ae1d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lists/v1alpha/patch_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,17 @@ def patch_list(
parent = f"projects/{proj_id}/locations/{proj_region}/instances/{proj_instance}"
url = f"{base_url_with_region}/v1alpha/{parent}/referenceLists/{name}"
body = {
"name": name,
"entries": [{"value": line.strip()} for line in content_lines]
"entries": [{"value": line.strip()} for line in content_lines],
"scope_info": None, # assumes Data RBAC is disabled
}
if description:
body["description"] = description
if syntax_type:
body["syntax_type"] = syntax_type
params = {"updateMask": ",".join(body.keys())}
body["name"] = name

# omit the updateMask query string param:
# "When no field mask is supplied, all non-empty fields will be updated."
response = http_session.request("PATCH", url, json=body)
response = http_session.request("PATCH", url, params=params, json=body)
if response.status_code >= 400:
print(response.text)
response.raise_for_status()
Expand Down

0 comments on commit f27ae1d

Please sign in to comment.