authorization

package
Version: v0.0.0-...-caf6f44 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnforceAdmin

func EnforceAdmin(ctx *Context) *fcerror.Error

func EnforceSelf

func EnforceSelf(ctx *Context, targetUserID models.UserID) *fcerror.Error

func EnforceSystem

func EnforceSystem(ctx *Context) *fcerror.Error

func EnforceUser

func EnforceUser(ctx *Context) *fcerror.Error

Types

type Context

type Context struct {
	Type ContextType
	User *models.User
}

func NewAnonymous

func NewAnonymous() *Context

func NewSystem

func NewSystem() *Context

func NewUser

func NewUser(user *models.User) *Context

type ContextType

type ContextType int
const (
	ContextTypeSystem ContextType = iota
	ContextTypeAnonymous
	ContextTypeUser
)

Jump to

Keyboard shortcuts

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