Skip to content

Instantly share code, notes, and snippets.

@tsandall
Created June 3, 2017 16:13
Show Gist options
  • Select an option

  • Save tsandall/3034c7fd8df7aa274b7210d384b14bed to your computer and use it in GitHub Desktop.

Select an option

Save tsandall/3034c7fd8df7aa274b7210d384b14bed to your computer and use it in GitHub Desktop.
package acmecorp.api
import data.acmecorp.roles
default allow = false
allow {
input.method = “GET”
input.path = [“accounts”, user]
input.user = user
}
allow {
input.method = “GET”
input.path = [“accounts”, “report”]
roles[input.user][_] = “admin”
}
allow {
input.method = “POST”
input.path = [“accounts”]
roles[input.user][_] = “admin”
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment