permissions

package
v0.0.0-...-7404a93 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PermissionNode

type PermissionNode struct {
	Identifier string
}

PermissionNode

type PermissionSystem

type PermissionSystem struct {
	Nodes []*PermissionNode
	Tree  permissionTree
}

PermissionSystem manages all permission checking and storage

func BuildPermissionSystem

func BuildPermissionSystem(permissionFile string) PermissionSystem

BuildPermissionSystem returns a to a loaded PermissionSystem based on the given file

func (*PermissionSystem) AddPermissionNode

func (pm *PermissionSystem) AddPermissionNode(nodeIdentifier string)

AddPermissionNode creates a new PermissionNode{} with the given identifier and appends it to the list of Nodes in this PermissionSystem

func (*PermissionSystem) AddReferences

func (pm *PermissionSystem) AddReferences()

AddReferences loops over all sets and groups in the PermissionSystem, correctly populating any lists of associations based on the raw* field

func (*PermissionSystem) UserHasPermissionNode

func (pm *PermissionSystem) UserHasPermissionNode(member *discordgo.Member, nodeIdentifer string) bool

UserHasPermissionNode will return whether or not the given Member has the given nodeIdentifier or not

Jump to

Keyboard shortcuts

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