Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultEchoRBAC is the default BasicAuth middleware config. DefaultEchoRBAC = EchoRBAC{ Skipper: middleware.DefaultSkipper, } )
Functions ¶
This section is empty.
Types ¶
type EchoRBAC ¶
type EchoRBAC struct {
// Skipper defines a function to skip middleware.
Skipper middleware.Skipper
// SessionRolesKeyName is a string to find current user's roles(default is "roles")
SessionRolesKeyName string
RBAC *rbac.RBAC
}
EchoRBAC defines the config for RBAC middleware.
type IsGrantedFunc ¶
type IsGrantedFunc = func(perm *rbac.Permission, actions ...rbac.Action) echo.MiddlewareFunc
IsGrantedFunc is used to check grants
func HasRole ¶
func HasRole(R *rbac.RBAC) IsGrantedFunc
HasRole returns an HasRole middleware with default config.
func HasRoleWithConfig ¶
func HasRoleWithConfig(config EchoRBAC) IsGrantedFunc
HasRoleWithConfig returns an HasRole middleware with config.
Click to show internal directories.
Click to hide internal directories.