MCPcopy Create free account
hub / github.com/cloudwan/gohan / isMatchingPolicy

Function isMatchingPolicy

cli/template.go:362–364  ·  view source on GitHub ↗
(action schema.Action, policy *schema.Policy)

Source from the content-addressed store, hash-verified

360}
361
362func 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
366func filterPolicies(principal string, policies []*schema.Policy) []*schema.Policy {
367 var matchedPolicies []*schema.Policy

Callers 1

canUseActionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected