Documentation ¶
Index ¶
- func AllowGuest(next echo.HandlerFunc) echo.HandlerFunc
- func Auth(next echo.HandlerFunc) echo.HandlerFunc
- func Authentication(next echo.HandlerFunc) echo.HandlerFunc
- func HasPermission(p PermissionOption) func(next echo.HandlerFunc) echo.HandlerFunc
- func IsTestCaseSample(c echo.Context) (result bool)
- func Judger(next echo.HandlerFunc) echo.HandlerFunc
- func Logged(next echo.HandlerFunc) echo.HandlerFunc
- func Recover(next echo.HandlerFunc) echo.HandlerFunc
- type AndPermission
- type CustomPermission
- type OrPermission
- type PermissionOption
- type ScopedPermission
- type UnscopedPermission
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowGuest ¶
func AllowGuest(next echo.HandlerFunc) echo.HandlerFunc
Using this middleware means the controller could accept access from guests. The only exception is role information, guest users don't have any permissions or roles. Any user information other than roles SHOULD NOT be read in controllers that use this middleware.
func Authentication ¶
func Authentication(next echo.HandlerFunc) echo.HandlerFunc
func HasPermission ¶
func HasPermission(p PermissionOption) func(next echo.HandlerFunc) echo.HandlerFunc
func IsTestCaseSample ¶
func IsTestCaseSample(c echo.Context) (result bool)
Types ¶
type AndPermission ¶
type AndPermission struct { A PermissionOption B PermissionOption }
func (AndPermission) Check ¶
func (p AndPermission) Check(c echo.Context) bool
type CustomPermission ¶
type CustomPermission struct {
F func(c echo.Context) bool
}
func (CustomPermission) Check ¶
func (p CustomPermission) Check(c echo.Context) bool
type OrPermission ¶
type OrPermission struct { A PermissionOption B PermissionOption }
func (OrPermission) Check ¶
func (p OrPermission) Check(c echo.Context) bool
type PermissionOption ¶
type PermissionOption interface {
Check(ctx echo.Context) bool
}
type ScopedPermission ¶
func (ScopedPermission) Check ¶
func (p ScopedPermission) Check(c echo.Context) bool
type UnscopedPermission ¶
type UnscopedPermission struct {
P string
}
func (UnscopedPermission) Check ¶
func (p UnscopedPermission) Check(c echo.Context) bool
Click to show internal directories.
Click to hide internal directories.