Skip to content

Instantly share code, notes, and snippets.

@anderseknert
Created September 20, 2023 12:52
Show Gist options
  • Save anderseknert/122793cd9beab1e633fc62ec73c98fcf to your computer and use it in GitHub Desktop.
Save anderseknert/122793cd9beab1e633fc62ec73c98fcf to your computer and use it in GitHub Desktop.
object.get
allow if {
# return input.user.name, or "anyomous" if the lookup fails
user := object.get(input, ["user", "name"], "anonymous")
user != "anonymous"
# ... more conditions
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment