hopfenspace / MateBot

Micro service providing an API for MateBot clients

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add voucher support to balance changing commands

CrsiX opened this issue · comments

commented

As soon as #27 has been implemented, the following list of commands should be changed accordingly, so that they can only be executed by external users that have an internal creditor:

  • /send
  • /zwegat
  • /blame
  • /communism (however, how should the other folks now about it when it's obviously not posted in the internal group chat?)
  • /pay (however, how should the other folks now about it when it's obviously not posted in the internal group chat?)
  • any consume command, e.g. currently /drink or /ice
commented

External users without creditor (user.credtior is None) will see the following message when trying to execute one of the commands listed above:

You can't perform {self.name}. You are an external user without creditor. For security purposes, every external user needs an internal voucher. Use /help for more information.

External users will see the following message when they try to perform a command for internals only:

You can't perform {self.name}. You are an external user. To perform this command, you must be marked as internal user. Send any command to an internal chat to update your privileges.

Furthermore, when an internal user without vote permissions tries to execute a command that requires vote permissions, the following message will be shown:

You can't perform {self.name}. You don't have permissions to vote.

commented

Overview over the required permission levels:

  • /blame: 2 (internals only)
  • /communism: 1 (externals with creditor and internals)
  • /pay: 1 (externals with creditor and internals)
  • /send: 1 (externals with creditor and internals)
  • /vouch: 2 (internals only)
  • /zwegat: 2 (internals only)
  • any consume command: 1 (externals with creditor and internals)

Any other command has no such check and can therefore be executed by any user.

Currently, permission level 3 is not used.