Documentation
¶
Index ¶
- Constants
- Variables
- func Allow(c echo.Context, v permissions.Verb, o permissions.Validable) error
- func AllowTypeAndID(c echo.Context, v permissions.Verb, doctype, id string) error
- func AllowWholeType(c echo.Context, v permissions.Verb, doctype string) error
- func Extractor(next echo.HandlerFunc) echo.HandlerFunc
- func Routes(router *echo.Group)
Constants ¶
View Source
const ContextClaims = "token_claims"
ContextClaims is the key used in echo context to store claims #nosec
View Source
const ContextPermissionSet = "permissions_set"
ContextPermissionSet is the key used in echo context to store permissions set
Variables ¶
View Source
var ( ALL = permissions.ALL GET = permissions.GET PUT = permissions.PUT POST = permissions.POST PATCH = permissions.PATCH DELETE = permissions.DELETE )
exports all constants from pkg/permissions to avoid double imports
View Source
var ErrNoToken = errors.New("No token in request")
ErrNoToken is returned whe the request has no token
Functions ¶
func Allow ¶
func Allow(c echo.Context, v permissions.Verb, o permissions.Validable) error
Allow validates the validable object against the context permission set
func AllowTypeAndID ¶
AllowTypeAndID validates a type & ID against the context permission set
func AllowWholeType ¶
AllowWholeType validates that the context permission set can use a verb on the whold doctype
func Extractor ¶
func Extractor(next echo.HandlerFunc) echo.HandlerFunc
Extractor extracts the permission set from the context
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.