permission

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Func added in v0.0.2

type Func func(permission string) TriState

Func is the permission function to obtain the TriState for permission.

type Subject

type Subject interface {
	HasPermission(permission string) bool // Equal to PermissionValue(...).Bool()
	PermissionValue(permission string) TriState
}

type TriState

type TriState uint8

TriState can be in three states (True, False, Undefined), used for a setting.

const (
	Undefined TriState = iota // A permission is undefined.
	True                      // A permission is allowed.
	False                     // A permission is explicitly denied.
)

func (TriState) Bool

func (t TriState) Bool() bool

Bool returns the bool value of a TriState where Undefined is converted to false.

Jump to

Keyboard shortcuts

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