authorize

package
v0.0.0-...-c6dbdfa Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasAtLeastRole

func HasAtLeastRole(requiredRole CourseRole, r *http.Request) bool

func RequiresAtLeastCourseRole

func RequiresAtLeastCourseRole(requiredRole CourseRole) func(next http.Handler) http.Handler

RequiresRole middleware restricts access to accounts having role parameter in their jwt claims.

Types

type CourseRole

type CourseRole int32
const (
	NOCOURSEROLE CourseRole = -1
	STUDENT      CourseRole = 0
	TUTOR        CourseRole = 1
	ADMIN        CourseRole = 2
)

func (CourseRole) ToInt

func (r CourseRole) ToInt() int

Jump to

Keyboard shortcuts

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