ginauth

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMiddleware

func NewMiddleware(e Enforcer, basePath string, errorHandler emperror.Handler) gin.HandlerFunc

NewMiddleware returns a new gin middleware that checks user authorization.

Types

type Enforcer

type Enforcer interface {
	Enforce(org *auth.Organization, user *auth.User, path, method string, query url.Values) (bool, error)
}

Enforcer checks if the current user has access to the organization resource under path with method

Jump to

Keyboard shortcuts

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