           msg.send output.sort().join('\n')
 
   robot.respond /sensu client (?:http\:\/\/)?(.*)( history)/i, (msg) ->
+    unless robot.auth.hasRole(msg.envelope.user, config.sensu_roles)
+      msg.send "Access denied."
+      return
     validateVars
     client = msg.match[1]
 

        msg.send output.sort().join('\n')

  robot.respond /(?:sensu)? resolve event (?:http\:\/\/)?(.*)(?:\/)(.*)/i, (msg) ->
    validateVars
    client = msg.match[1]


#### Info methods ####
######################
  robot.respond /sensu help/i, (msg) ->
    unless robot.auth.hasRole(msg.envelope.user, config.sensu_roles)
      msg.send "Access denied."
      return

    cmds = robot.helpCommands()
    cmds = (cmd for cmd in cmds when cmd.match(/(sensu)/))
    msg.send cmds.join("\n")

  robot.respond /sensu info/i, (msg) ->
    unless robot.auth.hasRole(msg.envelope.user, config.sensu_roles)
      msg.send "Access denied."
      return
    validateVars
    credential = createCredential()

    req = robot.http(config.sensu_api + '/info', http_options)
    if credential
      req = req.headers(Authorization: credential)
