casbin

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Enforcer ...
	Enforcer *casbin.SyncedEnforcer
)

Functions

func EnforceRoute added in v0.5.0

func EnforceRoute(role *model.UserRole, resourceID string, req *http.Request, enforcer casbin.IEnforcer) (bool, error)

EnforceRoute 验证web路由

func Init

func Init()

Init 初始化casbin https://github.com/casbin/gorm-adapter

func MyDomKeyMatch2Func

func MyDomKeyMatch2Func(args ...interface{}) (interface{}, error)

MyDomKeyMatch2Func 定义域KeyMatch2

func MyRegexMatchFunc

func MyRegexMatchFunc(args ...interface{}) (interface{}, error)

MyRegexMatchFunc 定义域RegexMatch

Types

This section is empty.

Jump to

Keyboard shortcuts

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