MCPcopy
hub / github.com/apache/casbin / LoadModelFromText

Method LoadModelFromText

model/model.go:173–180  ·  view source on GitHub ↗

LoadModelFromText loads the model from the text.

(text string)

Source from the content-addressed store, hash-verified

171
172// LoadModelFromText loads the model from the text.
173func (model Model) LoadModelFromText(text string) error {
174 cfg, err := config.NewConfigFromText(text)
175 if err != nil {
176 return err
177 }
178
179 return model.loadModelFromConfig(cfg)
180}
181
182// loadModelFromConfig loads the model from a config interface.
183// It loads all sections defined in sectionNameMap and validates that required sections are present.

Callers 4

NewModelFromStringFunction · 0.95
testModelToTextFunction · 0.95
Test_KeyMatchRbacFunction · 0.95
Test_StringRbacFunction · 0.95

Calls 2

loadModelFromConfigMethod · 0.95
NewConfigFromTextFunction · 0.92

Tested by 3

testModelToTextFunction · 0.76
Test_KeyMatchRbacFunction · 0.76
Test_StringRbacFunction · 0.76