     if !robot.brain.data.variables[varname]
       msg.reply "Sorry, I don't know of a variable '" + varname + "'."
       return
-    if !can_edit_var msg.message.user, varname
+    if !robot.variables.can_edit_var msg.message.user, varname
       msg.reply "Sorry, you don't have permissions to edit '"+varname+"'."
       return
     if value.match(variableRE)

      msg.reply "Okay, removed variable " + varname
    delete robot.brain.data.variables[varname]

  robot.respond /add value (\w+) (.*)$/, (msg) ->
    varname = msg.match[1]
    value = msg.match[2]
    lcvalue = value.toLowerCase()

    robot.brain.data.variables[varname].type = msg.match[2]
    msg.reply "Okay."

  robot.hear /^list var (\w+)$/, (msg) ->
    varname = msg.match[1]
    if !robot.brain.data.variables[varname]
      msg.reply "Sorry, I don't know of a variable '" + varname + "'."
      return
    msg.reply robot.brain.data.variables[varname].values.join(', ')

  robot.hear /^list vars$/, (msg) ->
    ret = []
    for varname in Object.keys(robot.brain.data.variables)
      v = robot.brain.data.variables[varname]
