InitWithFile initializes an enforcer with a model file and a policy file.
(modelPath string, policyPath string)
| 139 | |
| 140 | // InitWithFile initializes an enforcer with a model file and a policy file. |
| 141 | func (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. |
| 147 | func (e *Enforcer) InitWithAdapter(modelPath string, adapter persist.Adapter) error { |
no test coverage detected