Created
June 7, 2020 10:26
-
-
Save RajputVaibhav/d9a043a0b07d80e20e309419f715ee9c to your computer and use it in GitHub Desktop.
This is a simple OPA policy written in Rego. For context check the Medium blog
This file contains 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 play | |
default allow = false | |
allow = true { | |
input.method = "GET" | |
input.path = ["salary",employee_id] | |
input.user = employee_id | |
} | |
allow = true { | |
input.method = "GET" | |
input.path = ["salary",employee_id] | |
input.user = employee_id | |
} | |
managers = { | |
"gilfoyle": {"richard","erlich"}, | |
"richard": {"erlich"}, | |
} | |
test_allow { | |
allow with input as {"method": "GET", "user": "richard", "path": ["salary","gilfoyle"]} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment