Documentation ¶
Index ¶
- type GormAdapter
- func (a *GormAdapter) AddPolicy(sec string, ptype string, rule []string) error
- func (a *GormAdapter) LoadPolicy(model model.Model) error
- func (a *GormAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *GormAdapter) RemovePolicy(sec string, ptype string, rule []string) error
- func (a *GormAdapter) SavePolicy(model model.Model) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormAdapter ¶
type GormAdapter struct {
// contains filtered or unexported fields
}
MysqlGormAdapter represents the Xorm adapter for policy storage.
func NewGormAdapter ¶
func NewGormAdapter() *GormAdapter
func (*GormAdapter) AddPolicy ¶
func (a *GormAdapter) AddPolicy(sec string, ptype string, rule []string) error
AddPolicy adds a policy rule to the storage.
func (*GormAdapter) LoadPolicy ¶
func (a *GormAdapter) LoadPolicy(model model.Model) error
LoadPolicy loads policy from database.
func (*GormAdapter) RemoveFilteredPolicy ¶
func (a *GormAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
RemoveFilteredPolicy removes policy rules that match the filter from the storage.
func (*GormAdapter) RemovePolicy ¶
func (a *GormAdapter) RemovePolicy(sec string, ptype string, rule []string) error
RemovePolicy removes a policy rule from the storage.
func (*GormAdapter) SavePolicy ¶
func (a *GormAdapter) SavePolicy(model model.Model) error
SavePolicy saves policy to database.
Click to show internal directories.
Click to hide internal directories.