adapter

package
v0.0.0-...-98849e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

CasbinAdapterSet 注入CasbinAdapter

Functions

This section is empty.

Types

type CasbinAdapter

type CasbinAdapter struct {
	RoleModel         model.IRole
	RoleMenuModel     model.IRoleMenu
	MenuResourceModel model.IMenuActionResource
	UserModel         model.IUser
	UserRoleModel     model.IUserRole
}

CasbinAdapter casbin适配器

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

LoadPolicy 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL