       msg.send {room: msg.message.user.name}, "Project deleted: #{projname}"
 
   robot.respond /tf (plan|refresh|apply|destroy) ([^\s]+)( verbose)?$/i, (msg) ->
-    unless robot.auth.isAdmin(msg.envelope.user) or robot.auth.hasRole(msg.envelope.user,tfRole)
-      return msg.send {room: msg.message.user.name}, "Not authorized.  Missing #{tfRole} role."
+    return unless isAuthorized robot, msg
 
     action = msg.match[1]
     projname = msg.match[2].replace /\//, "_"

    return msg.send {room: msg.message.user.name}, "```\n#{pubkey}\n```"

  robot.respond /tf destroy key$/i, (msg) ->
    unless robot.auth.isAdmin(msg.envelope.user) or robot.auth.hasRole(msg.envelope.user,tfRole)
      return msg.send {room: msg.message.user.name}, "Not authorized.  Missing #{tfRole} role."

    if ! fs.existsSync("#{publickey}")
      return msg.send {room: msg.message.user.name}, "No key on file!  Create one first."

    return msg.send {room: msg.message.user.name}, dir.join "\n"

  robot.respond /tf remote ([^\s]+)$/i, (msg) ->
    return unless isAuthorized robot, msg

    projname = msg.match[1].replace /\//, "_"

