|  | @@ -5,6 +5,9 @@ this.Documents = new Mongo.Collection("documents");
 | 
	
		
			
				|  |  |  EditingUsers = new Mongo.Collection("editingUsers");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  if (Meteor.isClient) {
 | 
	
		
			
				|  |  | +  Meteor.subscribe("documents");
 | 
	
		
			
				|  |  | +  Meteor.subscribe("editingUsers");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    Template.editor.helpers({
 | 
	
		
			
				|  |  |      // Return the id of the first document you can find.
 | 
	
		
			
				|  |  |      docid: function () {
 | 
	
	
		
			
				|  | @@ -113,6 +116,15 @@ if (Meteor.isClient) {
 | 
	
		
			
				|  |  |  } // end isClient...
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  if (Meteor.isServer) {
 | 
	
		
			
				|  |  | +  Meteor.publish("documents", function () {
 | 
	
		
			
				|  |  | +    Meteor._debug("Publishing documents");
 | 
	
		
			
				|  |  | +    return Documents.find({ isPrivate: false });
 | 
	
		
			
				|  |  | +  });
 | 
	
		
			
				|  |  | +  Meteor.publish("editingUsers", function () {
 | 
	
		
			
				|  |  | +    Meteor._debug("Publishing all editingUsers");
 | 
	
		
			
				|  |  | +    return EditingUsers.find();
 | 
	
		
			
				|  |  | +  });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    Meteor.startup(function () {
 | 
	
		
			
				|  |  |      // Insert a document if there isn't one already.
 | 
	
		
			
				|  |  |      if (!Documents.findOne()) {
 | 
	
	
		
			
				|  | @@ -145,7 +157,7 @@ Meteor.methods({
 | 
	
		
			
				|  |  |      if (!this.userId) {
 | 
	
		
			
				|  |  |        return;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -    let res = Documents.update({ _id: doc._id, owner: this.userId }, { $set: { private: doc.isPrivate } });
 | 
	
		
			
				|  |  | +    let res = Documents.update({ _id: doc._id, owner: this.userId }, { $set: { isPrivate: doc.isPrivate } });
 | 
	
		
			
				|  |  |      Meteor._debug("update", res);
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |  
 |