Function
isMatchingPolicy
(action schema.Action, policy *schema.Policy)
Source from the content-addressed store, hash-verified
| 360 | } |
| 361 | |
| 362 | func isMatchingPolicy(action schema.Action, policy *schema.Policy) bool { |
| 363 | return action.ID == policy.Action || policy.Action == "*" || (policy.Action == "read" && action.Method == "GET") || (policy.Action == "update" && action.Method == "POST") |
| 364 | } |
| 365 | |
| 366 | func filterPolicies(principal string, policies []*schema.Policy) []*schema.Policy { |
| 367 | var matchedPolicies []*schema.Policy |
Tested by
no test coverage detected