rbac

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAccess

func CheckAccess(role Role, reqPath string, reqMethod string) (valid bool, err error)

CheckAccess checks whether the request access is valid or not, which returns error only when regexp pattern is invalid

func RegisterAccess

func RegisterAccess(role Role, accessList AccessList)

RegisterAccess registers new access list for a specified role

Types

type Access

type Access struct {
	PathPattern string
	Method      string
}

Access controls the access to the path of the service by a specified http method

type AccessList

type AccessList []Access

type Role

type Role string

Jump to

Keyboard shortcuts

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