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

Method InitWithFile

enforcer.go:141–144  ·  view source on GitHub ↗

InitWithFile initializes an enforcer with a model file and a policy file.

(modelPath string, policyPath string)

Source from the content-addressed store, hash-verified

139
140// InitWithFile initializes an enforcer with a model file and a policy file.
141func (e *Enforcer) InitWithFile(modelPath string, policyPath string) error {
142 a := fileadapter.NewAdapter(policyPath)
143 return e.InitWithAdapter(modelPath, a)
144}
145
146// InitWithAdapter initializes an enforcer with a database adapter.
147func (e *Enforcer) InitWithAdapter(modelPath string, adapter persist.Adapter) error {

Callers 1

NewEnforcerFunction · 0.95

Calls 1

InitWithAdapterMethod · 0.95

Tested by

no test coverage detected