roles

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AdminOnly = []string{
		"/Install",
		"/Uninstall",

		"/HttpOpen",
		"/HttpsOpen",

		"/HttpClose",
		"/HttpsClose",

		"/TcpOpen",
		"/TcpClose",
	}
)

Functions

func AuthorizedEndpoint

func AuthorizedEndpoint(r Role, endpoint string) bool

AuthorizedEndpoint reports whether a player with the provided role is allowed to access the provided endpoint

func ValidRole

func ValidRole(r string) bool

ValidRole reports whether the specified role is a valid existing role

Types

type Role

type Role string
const (
	RoleAdmin  Role = "admin"
	RolePlayer Role = "player"
)

type Roles

type Roles []Role

func All

func All() Roles

All returns all roles

func (Roles) String

func (rs Roles) String() []string

Jump to

Keyboard shortcuts

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