echorbac

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: MIT Imports: 4 Imported by: 2

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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