ContextAdapter provides a context-aware interface for Casbin adapters.
| 22 | |
| 23 | // ContextAdapter provides a context-aware interface for Casbin adapters. |
| 24 | type 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…