audit

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 4 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) Sort added in v0.1.6

func (r Channels) Sort()

Sort the channels by position.

func (Channels) String added in v0.1.6

func (r Channels) String() string

type Inspection added in v0.1.6

type Inspection struct {
	Roles map[string]int64
	// contains filtered or unexported fields
}

Inspection on a server.

func (*Inspection) Admin added in v0.1.6

func (i *Inspection) Admin(role *discordgo.Role)

Admin permissions (admin and manager) should only be assigned to the Admin role. Roles that incorrectly have administrator permissions will be added to the inspection report.

func (*Inspection) Base added in v0.1.6

func (i *Inspection) Base(role *discordgo.Role)

Base permissions check. Roles should have 0 permissions, base permissions, or be listed in the Inspection.Roles set with the expected permissions.

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.

func (*Inspection) Overwrites added in v0.1.6

func (i *Inspection) Overwrites(channel *discordgo.Channel)

Overwrites check the channel overwrites are as we expect.

func (*Inspection) Report added in v0.1.6

func (i *Inspection) Report() []string

Report on the Inspection.

type Roles

type Roles []*discordgo.Role

Roles in a Discord server.

func (Roles) Sort added in v0.1.6

func (r Roles) Sort()

Sort the roles by position.

func (Roles) String added in v0.1.6

func (r Roles) String() string

Jump to

Keyboard shortcuts

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