MCPcopy Index your code
hub / github.com/apache/casbin / SetModel

Method SetModel

enforcer.go:227–232  ·  view source on GitHub ↗

SetModel sets the current model.

(m model.Model)

Source from the content-addressed store, hash-verified

225
226// SetModel sets the current model.
227func (e *Enforcer) SetModel(m model.Model) {
228 e.model = m
229 e.fm = model.LoadFunctionMap()
230
231 e.initialize()
232}
233
234// GetAdapter gets the current adapter.
235func (e *Enforcer) GetAdapter() persist.Adapter {

Callers 2

TestGetAndSetModelFunction · 0.95
TestInitEmptyFunction · 0.95

Calls 2

initializeMethod · 0.95
LoadFunctionMapFunction · 0.92

Tested by 2

TestGetAndSetModelFunction · 0.76
TestInitEmptyFunction · 0.76