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
Click to show internal directories.
Click to hide internal directories.