Skip to content

Instantly share code, notes, and snippets.

@tsandall
Last active May 12, 2017 17:05
Show Gist options
  • Select an option

  • Save tsandall/9c825e7f3288d9a1efd6a3a71532b881 to your computer and use it in GitHub Desktop.

Select an option

Save tsandall/9c825e7f3288d9a1efd6a3a71532b881 to your computer and use it in GitHub Desktop.
Authorization Examples
package httpapi.authz
default allow = false
# Allow users to get their own salaries.
allow {
input.method = "GET"
input.path = ["finance", "salary", user]
user = input.user
}
# Allow managers to get their subordinates' salaries.
allow {
input.method = "GET"
input.path = ["finance", "salary", user]
manager_of[user] = input.user
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment