()
| 182 | } |
| 183 | |
| 184 | func (e *Enforcer) initialize() { |
| 185 | e.rmMap = map[string]rbac.RoleManager{} |
| 186 | e.condRmMap = map[string]rbac.ConditionalRoleManager{} |
| 187 | e.eft = effector.NewDefaultEffector() |
| 188 | e.watcher = nil |
| 189 | e.matcherMap = sync.Map{} |
| 190 | |
| 191 | e.enabled = true |
| 192 | e.autoSave = true |
| 193 | e.autoBuildRoleLinks = true |
| 194 | e.autoNotifyWatcher = true |
| 195 | e.autoNotifyDispatcher = true |
| 196 | e.initRmMap() |
| 197 | |
| 198 | // Initialize detectors with default detector if not already set |
| 199 | if e.detectors == nil { |
| 200 | e.detectors = []detector.Detector{detector.NewDefaultDetector()} |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | // LoadModel reloads the model from the model CONF file. |
| 205 | // Because the policy is attached to a model, so the policy is invalidated and needs to be reloaded by calling LoadPolicy(). |
no test coverage detected