Closed jeffreywescott closed 8 years ago
Holding a tension about what feels like too much duplicate role check-related code. Specifically:
roles.indexOf()
checks (minor, minor perf issue, but much more concerned about maintainability following any changes to roles)Thoughts?
LGTM
@prattsj: maybe we need a isPlayer(lgUser)
function to put all of that in one place?
@bundacia: or perhaps even something more generic, like:
userHasRole(lgUser, ROLE_NAME_CONSTANT)
Or both, which is what we ended up with. :-)
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 anlgPlayer
being passed-in.