Skip to content

Commit

Permalink
Update rego example
Browse files Browse the repository at this point in the history
  • Loading branch information
zalbiraw committed Oct 24, 2024
1 parent 939827f commit 1c3449b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/deployments/opa/dashboard.rego
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,16 @@ deny[x] {
x := "You are not permitted you use Custom Go Plugin Authetication."
}

apply_group_ownership = ownership {
input.request.body["x-tyk-api-gateway"] != null
ownership := {}
} else = ownership {
ownership := {"user_group_owners": [input.user.group_id]}
apply_group_ownership = payload {
input.request.body["api_definition"] != null
input.user.group_id != ""
payload := {"user_group_owners": [input.user.group_id]}
} else = payload {
endswith(input.request.path, "/access")
input.user.group_id != ""
payload := {"userGroupIds": [input.user.group_id]}
} else = payload {
payload := {}
}

patch_request[x] {
Expand Down

0 comments on commit 1c3449b

Please # to comment.