       return arg.fetch()
     return []
 
+  # @param {Array.<Meteor.Collection>} collections
+  # @returns {Object.<String, Meteor.Collection>} A map of collection name to object for the given
+  #      collections.
+  getMap: (collections) ->
+    collectionMap = {}
+    _.each collections, (collection) =>
+      name = @getName(collection)
+      collectionMap[name] = collection
+    collectionMap
+
+  # @param {Object.<String, String>} map - A map of IDs to names of the items.
+  # @returns A temporary collection with items created from the given map.
+  fromNameMap: (map, args) ->
+    args = _.extend({
+    }, args)
+    collection = Collections.createTemporary()
+    callback = args.callback
+    _.each map, (item, id) ->
+      if callback
+        name = callback(item, id)
+      else
+        name = item
+      collection.insert(_id: id, name: name)
+    collection
+
   createTemporary: (docs) ->
     collection = new Meteor.Collection(null)
     @insertAll(docs, collection)

    else
      handle(result)

  intersection: (a, b) ->
    result = @createTemporary()
    a.find().forEach (item) ->
      if b.findOne(item._id)
        result.insert(item)
    result

global = @

Collections =

####################################################################################################
# COLLECTIONS
####################################################################################################

  allow: -> true
  allowAll: -> insert: @allow, update: @allow, remove: @allow
