Enforcer is the main interface for authorization enforcement and policy management.
| 36 | |
| 37 | // Enforcer is the main interface for authorization enforcement and policy management. |
| 38 | type Enforcer struct { |
| 39 | modelPath string |
| 40 | model model.Model |
| 41 | fm model.FunctionMap |
| 42 | eft effector.Effector |
| 43 | |
| 44 | adapter persist.Adapter |
| 45 | watcher persist.Watcher |
| 46 | dispatcher persist.Dispatcher |
| 47 | rmMap map[string]rbac.RoleManager |
| 48 | condRmMap map[string]rbac.ConditionalRoleManager |
| 49 | matcherMap sync.Map |
| 50 | logger log.Logger |
| 51 | detectors []detector.Detector |
| 52 | |
| 53 | enabled bool |
| 54 | autoSave bool |
| 55 | autoBuildRoleLinks bool |
| 56 | autoNotifyWatcher bool |
| 57 | autoNotifyDispatcher bool |
| 58 | acceptJsonRequest bool |
| 59 | |
| 60 | aiConfig AIConfig |
| 61 | } |
| 62 | |
| 63 | // EnforceContext is used as the first element of the parameter "rvals" in method "enforce". |
| 64 | type EnforceContext struct { |
nothing calls this directly
no outgoing calls
no test coverage detected