       else
         for tid in data.tidbits
           @tidbits.push tid
+    can_edit: (user) ->
+      if user.roles
+        if "edit_factoids" in user.roles
+          return true
+        if "edit_factoid_" + @name in user.roles
+          return true
+      return !!@readonly
     tidbit: () ->
       @tidbits[Math.floor(Math.random() * @tidbits.length)]
     toObj: () ->

    msg.reply "FIXME - not implemented yet"

  robot.hear /^forget (.*)#(\d+)$/, (msg) =>
    factoid_name = msg.match[1]
    tid = parseInt(msg.match[2], 10)-1
    factoid = robot.factoid.get factoid_name
    if !factoid
      msg.reply "No such factoid"
      return
    if tid < 0
      msg.reply "Sorry, you must provide a number greater than 0 (as this is 1 based)"


  robot.hear /^literal(?:\[([*\d]+)\])?\s+(.*)$/, (msg) =>
    page = msg.match[1]
    factoid_name = msg.match[2].trim()
    factoid = robot.factoid.get factoid_name
    if !factoid
      msg.reply "No such factoid"
