audit

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package audit provides channel and role audit functionality. The audit rules are:

  • Admin role can only be held by specific roles
  • @everyone role must match specific permissions
  • Any roles providing extra permissions must be explicitly defined
  • Channels should only provide visibility for a single base role
  • Exceptions to be explicit
  • Read Only channels can provide custom permissions for the role allowed to
  • write.

Index

Constants

This section is empty.

Variables

View Source
var RolePermissions = map[string]int64{
	"@everyone":        basePermissions,
	"Amenity Leader":   1071698538049,
	"Mods":             1440260156551,
	"Discord Security": 2196338376671,
	"Announcements":    2198083203015,
	"Admin":            2189895925759,
	"Owner":            1069551046217,
}

RolePermissions we expect.

Functions

This section is empty.

Types

type Channels

type Channels []*discordgo.Channel

Channels in a Discord server.

func (Channels) Names added in v0.1.7

func (c Channels) Names() []string

Names of the channels in this set.

func (Channels) Sort added in v0.1.6

func (c Channels) Sort()

Sort the channels by position.

type Inspection added in v0.1.6

type Inspection struct {
	Admin Roles
	Base  Roles
	Deny  Channels
	Allow Channels
	Roles map[string]int64
}

Inspection on a server.

func (*Inspection) Check added in v0.1.6

func (i *Inspection) Check(session *discordgo.Session, id string) error

Check the given server for permission violations.

type Roles

type Roles []*discordgo.Role

Roles in a Discord server.

func (Roles) Names added in v0.1.7

func (r Roles) Names() []string

Names of the roles in this set.

func (Roles) Sort added in v0.1.6

func (r Roles) Sort()

Sort the roles by position.

Jump to

Keyboard shortcuts

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