diff --git a/package.json b/package.json index c55c018..2ae94f8 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "grunt-contrib-watch": "~0.5.3", "grunt-mocha-test": "~0.7.0", "grunt-release": "~0.6.0", - "hubot": "^2.7.5", + "hubot": "^2.14.0", "hubot-mock-adapter": "^1.0.0", "matchdep": "~0.1.2", "mocha": "*" diff --git a/src/auth.coffee b/src/auth.coffee index 626a216..ed42c02 100644 --- a/src/auth.coffee +++ b/src/auth.coffee @@ -26,6 +26,10 @@ config = admin_list: process.env.HUBOT_AUTH_ADMIN module.exports = (robot) -> + robot.listenerMiddleware (context, next, done) -> + context.response.message.user.groups = (cb) -> + cb(robot.auth.userRoles(context.response.message.user)) + next() unless config.admin_list? robot.logger.warning 'The HUBOT_AUTH_ADMIN environment variable not set'