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

Interface Adapter

persist/adapter.go:64–79  ·  view source on GitHub ↗

Adapter is the interface for Casbin adapters.

Source from the content-addressed store, hash-verified

62
63// Adapter is the interface for Casbin adapters.
64type Adapter interface {
65 // LoadPolicy loads all policy rules from the storage.
66 LoadPolicy(model model.Model) error
67 // SavePolicy saves all policy rules to the storage.
68 SavePolicy(model model.Model) error
69
70 // AddPolicy adds a policy rule to the storage.
71 // This is part of the Auto-Save feature.
72 AddPolicy(sec string, ptype string, rule []string) error
73 // RemovePolicy removes a policy rule from the storage.
74 // This is part of the Auto-Save feature.
75 RemovePolicy(sec string, ptype string, rule []string) error
76 // RemoveFilteredPolicy removes policy rules that match the filter from the storage.
77 // This is part of the Auto-Save feature.
78 RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
79}

Callers 47

LoadPolicyMethod · 0.65
LoadPolicyMethod · 0.65
loadPolicyFromAdapterMethod · 0.65
LoadPolicyMethod · 0.65
ClearPolicySelfMethod · 0.65
SavePolicyMethod · 0.65
TestLoadFilteredPolicyFunction · 0.65
SavePolicyMethod · 0.65
SavePolicyMethod · 0.65
TestTransactionRollbackFunction · 0.65

Implementers 6

MockTransactionalAdaptertransaction_test.go
Enforcerenforcer.go
SyncedEnforcerenforcer_synced.go
Adapterpersist/file-adapter/adapter.go
AdapterMockpersist/file-adapter/adapter_mock.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…