Skip to content

Instantly share code, notes, and snippets.

@adam-sandor
Created July 8, 2021 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adam-sandor/53b95aa24480982e34bf2ed236237be7 to your computer and use it in GitHub Desktop.
Save adam-sandor/53b95aa24480982e34bf2ed236237be7 to your computer and use it in GitHub Desktop.
Rego rule 2 - Managers can create employees only in their own group
allow {
input.attributes.request.http.method == "POST"
input.parsed_path[0] == "employees"
jwt.valid
jwt.payload.Role == "manager"
jwt.payload.Group == input.parsed_body.userGroup
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment