MCPcopy
hub / github.com/apache/casbin / Enforcer

Struct Enforcer

enforcer.go:38–61  ·  view source on GitHub ↗

Enforcer is the main interface for authorization enforcement and policy management.

Source from the content-addressed store, hash-verified

36
37// Enforcer is the main interface for authorization enforcement and policy management.
38type 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".
64type EnforceContext struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected