principal

package
v1.0.2-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestrictTo

func RestrictTo(pType enum.PrincipalType) func(http.Handler) http.Handler

* RestrictTo returns an http.HandlerFunc middleware that ensures the principal * is of the provided type. In case there is no authenticated principal, * or the principal type doesn't match, an error is rendered.

func RestrictToAdmin

func RestrictToAdmin() func(http.Handler) http.Handler

* RestrictToAdmin returns an http.HandlerFunc middleware that ensures the principal * is an admin. In case there is no authenticated principal, * or the principal isn't an admin, an error is rendered.

Types

This section is empty.

Jump to

Keyboard shortcuts

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