Documentation ¶
Index ¶
- type Adapter
- func (a *Adapter) AddPolicies(sec string, ptype string, rules [][]string) (err error)
- func (a *Adapter) AddPolicy(sec string, ptype string, rule []string) (err error)
- func (a *Adapter) LoadPolicy(model model.Model) error
- func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) (err error)
- func (a *Adapter) RemovePolicies(sec string, ptype string, rules [][]string) (err error)
- func (a *Adapter) RemovePolicy(sec string, ptype string, line []string) (err error)
- func (a *Adapter) SavePolicy(model model.Model) error
- type CasbinRule
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 ...
func NewAdapter ¶
func NewAdapter(db *badgerhold.Store, builtinPolicy string) (res *Adapter, err1 error)
NewAdapter ...
func (*Adapter) AddPolicies ¶
AddPolicies inserts or updates multiple rules by iterating over each one and inserting it into the badgerdb
func (*Adapter) RemoveFilteredPolicy ¶
func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) (err error)
RemoveFilteredPolicy ...
func (*Adapter) RemovePolicies ¶
RemovePolicies removes multiple policies.
func (*Adapter) RemovePolicy ¶
RemovePolicy removes a policy line that matches key
Click to show internal directories.
Click to hide internal directories.