Last active
May 12, 2017 17:05
-
-
Save tsandall/9c825e7f3288d9a1efd6a3a71532b881 to your computer and use it in GitHub Desktop.
Authorization Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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