permissions

package
v0.0.0-...-df918ef Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: ISC Imports: 3 Imported by: 0

Documentation

Overview

Package permissions offers an interface and implementation for permission handling of chat commands

Index

Constants

View Source
const Unauthorised = -1

Unauthorised is the level returned when a user has no special levels

Variables

This section is empty.

Functions

func AllPermissionMatch

func AllPermissionMatch(available, required []string) (bool, error)

AllPermissionMatch returns true if and only if every entry in `required` is met by an entry in `available`

func AnyPermissionMatch

func AnyPermissionMatch(available, required []string) (bool, error)

AnyPermissionMatch returns true if any pair of required and available match

Types

type Handler

type Handler interface {
	IsAuthorised(userToCheck *user.EphemeralUser, requiredPermissions []string) (bool, error)
}

Handler represents any string-based permission handler

Directories

Path Synopsis
Package function implements a simple single-function based permission handler
Package function implements a simple single-function based permission handler
Package mask provides a permissions.Handler implementation that works with traditional nick!user@host masks
Package mask provides a permissions.Handler implementation that works with traditional nick!user@host masks

Jump to

Keyboard shortcuts

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