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

Interface ContextAdapter

persist/adapter_context.go:24–39  ·  view source on GitHub ↗

ContextAdapter provides a context-aware interface for Casbin adapters.

Source from the content-addressed store, hash-verified

22
23// ContextAdapter provides a context-aware interface for Casbin adapters.
24type ContextAdapter interface {
25 // LoadPolicyCtx loads all policy rules from the storage with context.
26 LoadPolicyCtx(ctx context.Context, model model.Model) error
27 // SavePolicyCtx saves all policy rules to the storage with context.
28 SavePolicyCtx(ctx context.Context, model model.Model) error
29
30 // AddPolicyCtx adds a policy rule to the storage with context.
31 // This is part of the Auto-Save feature.
32 AddPolicyCtx(ctx context.Context, sec string, ptype string, rule []string) error
33 // RemovePolicyCtx removes a policy rule from the storage with context.
34 // This is part of the Auto-Save feature.
35 RemovePolicyCtx(ctx context.Context, sec string, ptype string, rule []string) error
36 // RemoveFilteredPolicyCtx removes policy rules that match the filter from the storage with context.
37 // This is part of the Auto-Save feature.
38 RemoveFilteredPolicyCtx(ctx context.Context, sec string, ptype string, fieldIndex int, fieldValues ...string) error
39}

Implementers 3

ContextEnforcerenforcer_context.go
Adapterpersist/file-adapter/adapter.go
Adapterpersist/string-adapter/adapter.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…