Created
July 8, 2021 16:10
-
-
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
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
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