Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultConfig is the default CasbinAuth middleware config. DefaultConfig = Config{ Skipper: middleware.DefaultSkipper, } )
Functions ¶
func Middleware ¶
func Middleware(ce *casbin.Enforcer, sc DataSource) echo.MiddlewareFunc
Middleware returns a CasbinAuth middleware.
func MiddlewareWithConfig ¶
func MiddlewareWithConfig(config Config) echo.MiddlewareFunc
MiddlewareWithConfig returns a CasbinAuth middleware with config.
Types ¶
type Config ¶
type Config struct { Skipper middleware.Skipper Enforcer *casbin.Enforcer Source DataSource }
Config defines the config for CasbinAuth middleware.
func (*Config) CheckPermission ¶
CheckPermission checks the role/path/method combination from the request.
type DataSource ¶
DataSource is the Authen from datasource
Click to show internal directories.
Click to hide internal directories.