LearnersGuild / echo-cli

Option parser for Learners Guild commands.
MIT License
0 stars 4 forks source link

support moderators: stop depending on `lgPlayer` #71

Closed jeffreywescott closed 8 years ago

jeffreywescott commented 8 years ago

Fixes #67

We need to make sure that moderators can issue any moderator-relevant command (like vote sliding out the voting panel).

Previously, some of the commands depended on information from the player record (e.g., chapterId, goalRepositoryURL). However, now all of the checking for that is (rightfully) done on the game server and this dependency is no longer in place.

The only thing remaining-in-use by game-cli from the lgPlayer attribute is the id (to ensure that the user is a player, which we can just as easily do with lgUser.roles). This commit removes any dependency that game-cli has on an lgPlayer being passed-in.

heyheyjp commented 8 years ago

Holding a tension about what feels like too much duplicate role check-related code. Specifically:

Thoughts?

bundacia commented 8 years ago

LGTM

bundacia commented 8 years ago

@prattsj: maybe we need a isPlayer(lgUser) function to put all of that in one place?

heyheyjp commented 8 years ago

@bundacia: or perhaps even something more generic, like:

userHasRole(lgUser, ROLE_NAME_CONSTANT)
jeffreywescott commented 8 years ago

Or both, which is what we ended up with. :-)