rbac

package
v10.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Collection of wire providers

Functions

This section is empty.

Types

type Casbinx

type Casbinx struct {
	Cache           cachex.Cacher
	MenuDAL         *dal.Menu
	MenuResourceDAL *dal.MenuResource
	RoleDAL         *dal.Role
	// contains filtered or unexported fields
}

Load rbac permissions to casbin

func (*Casbinx) GetEnforcer

func (a *Casbinx) GetEnforcer() *casbin.Enforcer

func (*Casbinx) Load

func (a *Casbinx) Load(ctx context.Context) error

func (*Casbinx) Release

func (a *Casbinx) Release(ctx context.Context) error

type RBAC

type RBAC struct {
	DB       *gorm.DB
	MenuAPI  *api.Menu
	RoleAPI  *api.Role
	UserAPI  *api.User
	LoginAPI *api.Login
	Casbinx  *Casbinx
}

func (*RBAC) AutoMigrate

func (a *RBAC) AutoMigrate(ctx context.Context) error

func (*RBAC) Init

func (a *RBAC) Init(ctx context.Context) error

func (*RBAC) RegisterV1Routers

func (a *RBAC) RegisterV1Routers(ctx context.Context, v1 *gin.RouterGroup) error

func (*RBAC) Release

func (a *RBAC) Release(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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