Documentation ¶
Index ¶
- func InitAuth() (auth.Auther, error)
- func InitCaptcha()
- func InitCasbinEnforcer(container *dig.Container) error
- func InitPermission(ctx context.Context, container *dig.Container) error
- func InjectControllers(container *dig.Container) error
- func InjectStarage(container *dig.Container) error
- func NewCasbinEnforcer() *casbin.SyncedEnforcer
- func ReleaseCasbinEnforcer(container *dig.Container)
- type CasbinAdapter
- func (a *CasbinAdapter) AddPolicy(sec string, ptype string, rule []string) error
- func (a *CasbinAdapter) LoadPolicy(model model.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 model.Model) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitCasbinEnforcer ¶
InitCasbinEnforcer - Initialize the casbin checker
func InitPermission ¶
InitPermission - Initialize Permission data
func InjectControllers ¶
Inject - injection controllers implementation
func NewCasbinEnforcer ¶
func NewCasbinEnforcer() *casbin.SyncedEnforcer
NewCasbinEnforcer - Create casbin validator
func ReleaseCasbinEnforcer ¶
ReleaseCasbinEnforcer - Release casbin resources
Types ¶
type CasbinAdapter ¶
type CasbinAdapter struct { RoleBll controllers.IRole UserBll controllers.IUser }
CasbinAdapter - Casbin adapter
func NewCasbinAdapter ¶
func NewCasbinAdapter(bRole controllers.IRole, bUser controllers.IUser) *CasbinAdapter
NewCasbinAdapter - Create a casbin adapter
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 model.Model) error
LoadPolicy - Load 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 model.Model) error
SavePolicy saves all policy rules to the storage.
Directories ¶
Path | Synopsis |
---|---|
Package test Interface test How to use: go test -v
|
Package test Interface test How to use: go test -v |