permission

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CHECKER_APP_NAME = "permission"
)

Variables

View Source
var (
	ErrUnauthorized = exception.NewUnauthorized("auth required")
)

Functions

func Action

func Action(v string) (string, string)

func Audit

func Audit(v bool) (string, bool)

func Auth

func Auth(v bool) (string, bool)

func GetCheckerPriority

func GetCheckerPriority() int

func Permission

func Permission(v bool) (string, bool)

func Required

func Required(roles ...string) (string, []string)

func Resource

func Resource(v string) (string, string)

Types

type ApiRegister

type ApiRegister struct {
	ioc.ObjectImpl
	// contains filtered or unexported fields
}

func GetApiRegister

func GetApiRegister() *ApiRegister

func (*ApiRegister) Init

func (a *ApiRegister) Init() error

func (*ApiRegister) Name

func (c *ApiRegister) Name() string

func (*ApiRegister) Priority

func (i *ApiRegister) Priority() int

type Checker

type Checker struct {
	ioc.ObjectImpl
	// contains filtered or unexported fields
}

func (*Checker) Check

func (c *Checker) Check(r *restful.Request, w *restful.Response, next *restful.FilterChain)

func (*Checker) CheckPolicy

func (c *Checker) CheckPolicy(r *restful.Request, tk *token.Token, route *endpoint.RouteEntry) error

func (*Checker) CheckToken

func (c *Checker) CheckToken(r *restful.Request) (*token.Token, error)

func (*Checker) Init

func (c *Checker) Init() error

func (*Checker) Name

func (c *Checker) Name() string

func (*Checker) Priority

func (c *Checker) Priority() int

type MetaData

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

func NewMetaData

func NewMetaData(data map[string]any) *MetaData

func (*MetaData) GetBool

func (m *MetaData) GetBool(key string) bool

func (*MetaData) GetString

func (m *MetaData) GetString(key string) string

Jump to

Keyboard shortcuts

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