Documentation ¶
Index ¶
- type Adapter
- func (a *Adapter) AddPolicy(sec string, ptype string, rule []string) error
- func (a *Adapter) Close() error
- func (a *Adapter) LoadPolicy(model model.Model) error
- func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *Adapter) RemovePolicy(sec string, ptype string, policy []string) error
- func (a *Adapter) SavePolicy(model model.Model) 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 represents the adapter for policy storage
func NewAdapter ¶
NewAdapter creates the adapter object from a postgres url string
func NewAdapterByDB ¶
NewAdapterByDB creates a new casbin adapter with the db pointer supplied as an argument
func (*Adapter) LoadPolicy ¶
LoadPolicy loads data from the database and generates the access policy according to casbin requirements
func (*Adapter) RemoveFilteredPolicy ¶
func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
RemoveFilteredPolicy removes a filtered policy from database
func (*Adapter) RemovePolicy ¶
RemovePolicy removes a filtered policy from database
Click to show internal directories.
Click to hide internal directories.