Documentation ¶
Index ¶
- type Adapter
- func (a *Adapter) AddPolicies(sec string, ptype string, rules [][]string) error
- func (a *Adapter) AddPolicy(policyId string, ptype string, rule []string) error
- func (a *Adapter) LoadPolicy(m model.Model) error
- func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *Adapter) RemovePolicies(sec string, ptype string, rules [][]string) error
- func (a *Adapter) RemovePolicy(policyId string, ptype string, rule []string) error
- func (a *Adapter) SavePolicy(model model.Model) error
- func (a *Adapter) UpdatePolicies(sec string, ptype string, oldRules, newRules [][]string) error
- func (a *Adapter) UpdatePolicy(sec string, ptype string, oldRule, newPolicy []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is the file adapter for Casbin. It can load policy from file or save policy to file.
func (*Adapter) AddPolicies ¶
AddPolicies adds policy rules to the storage.
func (*Adapter) LoadPolicy ¶
LoadPolicy loads all policy rules from the storage into model.
func (*Adapter) RemoveFilteredPolicy ¶
func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
RemoveFilteredPolicy removes policy rules that match the filter from the storage.
func (*Adapter) RemovePolicies ¶
RemovePolicies removes policy rules from the storage.
func (*Adapter) RemovePolicy ¶
RemovePolicy removes a policy rule from the storage.
func (*Adapter) SavePolicy ¶
SavePolicy saves all policy rules to the storage.
func (*Adapter) UpdatePolicies ¶
Click to show internal directories.
Click to hide internal directories.