rbacx

package
v0.0.0-...-6d7266f Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiPolicy

type ApiPolicy struct {
	// contains filtered or unexported fields
}

func (*ApiPolicy) Desc

func (m *ApiPolicy) Desc() string

func (*ApiPolicy) Disable

func (m *ApiPolicy) Disable() bool

func (*ApiPolicy) HasPermission

func (m *ApiPolicy) HasPermission(roles []string) bool

判断是否有权限访问

func (*ApiPolicy) Module

func (m *ApiPolicy) Module() string

func (*ApiPolicy) Traceable

func (m *ApiPolicy) Traceable() bool

type IApiPolicy

type IApiPolicy interface {
	HasPermission(roles []string) bool
	Module() string
	Desc() string
	Disable() bool
	Traceable() bool
}

type RbacHolder

type RbacHolder struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRbacHolder

func NewRbacHolder(pr permissionrpc.PermissionRpc) *RbacHolder

func (*RbacHolder) GetPolicy

func (m *RbacHolder) GetPolicy(path string, method string) IApiPolicy

func (*RbacHolder) LoadPolicy

func (m *RbacHolder) LoadPolicy() error

Jump to

Keyboard shortcuts

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