Documentation ¶
Index ¶
- Variables
- type CasbinAdapter
- func (a *CasbinAdapter) AddPolicy(sec string, ptype string, rule []string) error
- func (a *CasbinAdapter) LoadPolicy(model casbinModel.Model) error
- func (a *CasbinAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *CasbinAdapter) RemovePolicy(sec string, ptype string, rule []string) error
- func (a *CasbinAdapter) SavePolicy(model casbinModel.Model) error
Constants ¶
This section is empty.
Variables ¶
View Source
var CasbinAdapterSet = wire.NewSet(wire.Struct(new(CasbinAdapter), "*"), wire.Bind(new(persist.Adapter), new(*CasbinAdapter)))
Functions ¶
This section is empty.
Types ¶
type CasbinAdapter ¶
type CasbinAdapter struct { RoleRepo *dao.RoleRepo RoleMenuRepo *dao.RoleMenuRepo MenuResourceRepo *dao.MenuActionResourceRepo MemberRepo *dao.MemberRepo MemberRoleRepo *dao.MemberRoleRepo }
func (*CasbinAdapter) AddPolicy ¶
func (a *CasbinAdapter) AddPolicy(sec string, ptype string, rule []string) error
AddPolicy adds a policy rule to the storage. This is part of the Auto-Save feature.
func (*CasbinAdapter) LoadPolicy ¶
func (a *CasbinAdapter) LoadPolicy(model casbinModel.Model) error
Loads all policy rules from the storage.
func (*CasbinAdapter) RemoveFilteredPolicy ¶
func (a *CasbinAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
RemoveFilteredPolicy removes policy rules that match the filter from the storage. This is part of the Auto-Save feature.
func (*CasbinAdapter) RemovePolicy ¶
func (a *CasbinAdapter) RemovePolicy(sec string, ptype string, rule []string) error
RemovePolicy removes a policy rule from the storage. This is part of the Auto-Save feature.
func (*CasbinAdapter) SavePolicy ¶
func (a *CasbinAdapter) SavePolicy(model casbinModel.Model) error
SavePolicy saves all policy rules to the storage.
Click to show internal directories.
Click to hide internal directories.