HGBot: IRC Access Decorator
completed by: TSharp
mentors: Jon Neal, Arc Riley, Terri Oda, David Czech, AJ Williams, Amaury Medeiros
HGBot is a Python program that automates our Mercurial repository management, handles Mercurial authentication, and provides user interfaces such as IRC.
We already have access levels and, within each command, checks are preformed to ensure the user has sufficient access to perform an action. Right now all commands are available to all users in a read-only capacity, but some uses of those commands require developer or administrator access. These checks are scattered around and clutter up the code.
Add a new Python decorator to check to ensure a user has at least a certain access level. Raise a standard UserError if the check fails, else pass. Where possible, refactor command functions to replace access level checks by adding this new decorator to appropriate functions. This will not possible for every access level check (such as the ACCESS command itself) but will work in many places.
While working on this task you should join and remain in #CopyleftGames on Freenode to get help, feedback, and guidance from mentors and other developers. Code updates which may affect your work are also announced here as they happen.
When you've done, commit your work and post the resulting changeset url to this task.