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

Method FilterSchema

schema/policy.go:482–490  ·  view source on GitHub ↗

FilterSchema filters properties in the schema itself

(
	properties map[string]interface{},
	propertiesOrder, required []string,
)

Source from the content-addressed store, hash-verified

480
481//FilterSchema filters properties in the schema itself
482func (p *Policy) FilterSchema(
483 properties map[string]interface{},
484 propertiesOrder, required []string,
485) (map[string]interface{}, []string, []string) {
486 filter := p.resource.PropertiesFilter
487 return filter.RemoveHiddenKeysFromMap(properties),
488 filter.RemoveHiddenKeysFromSlice(propertiesOrder),
489 filter.RemoveHiddenKeysFromSlice(required)
490}
491
492//Checks if user is authorized to perform given action
493func (p *Policy) Check(action string, authorization Authorization, data map[string]interface{}) error {

Callers 1

GetSchemaFunction · 0.80

Calls 2

Tested by

no test coverage detected