wip wiring up account forms

This commit is contained in:
cleverbeagle 2017-05-25 16:31:01 -05:00
parent cdc15f019d
commit 3459bf26f8
25 changed files with 413 additions and 53 deletions

View file

@ -0,0 +1,17 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import Documents from '../Documents';
Meteor.publish('documents', function documentsView() {
return Documents.find({ owner: this.userId });
});
// Note: documents.view is also used when editing an existing document.
Meteor.publish('documents.view', function documentsView(documentId) {
check(documentId, String);
const doc = Documents.find(documentId);
const isOwner = doc.fetch()[0].owner === this.userId;
return isOwner ? doc : this.ready();
});