Permissions

Purpose

Managing who can do what is important. Furthermore, many broadcasters are too busy to reasonably be entering commands for the bot, but also do not fully trust all moderators to do this sensibly. Or it could even be the case that there is someone who does not want to be a moderator, but is trusted to help manage the show. This module manages a Trusted User who often has the same permissions as the broadcaster, regardless of other status.

Use

There is a help() and tryParse() that can be called for managing the trusted users during the show; otherwise, these should be set during app/bot initialization.

Mostly, the functions present here are used through other modules, and so this module is a common dependency.

Interface

entrust()

Add the users to the trusted list. This elevates their permissions to the highest possible for non-broadcasters.

detrust()

Removes the users from the trusted list.

All Others

For the sake of being concise, all other exported functions are described here. There are fundamentally two groups of functions present for determining permissions. The first is narrow, like isBroadcaster(), isTrusted() or hasTokens(). These only determine that exact property. So if a user is a moderator but has no tokens, hasTokens() will return false. The second is cascading, like isAtLeastTrusted() or hasAtLeastTipped(). These check for if the user has that property, but also anything above it as well. So if a user is a moderator but hasn't tipped, hasAtLeastTipped() will still return true.

Hierarchy

  1. Broadcaster
  2. Trusted User
  3. Moderator
  4. Fanclub
  5. Tipped Tons
  6. Tipped A lot
  7. Tipped
  8. Has Tokens
  9. Grey

Requirements