|
@@ -65,6 +65,10 @@ if (Meteor.isClient) {
|
|
|
Template.docMeta.helpers({
|
|
|
document: function () {
|
|
|
return Documents.findOne({ _id: Session.get("docid") });
|
|
|
+ },
|
|
|
+ canEdit: function () {
|
|
|
+ let doc = Documents.findOne({ _id: Session.get("docid") });
|
|
|
+ return doc && doc.owner === Meteor.userId();
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -112,13 +116,17 @@ if (Meteor.isClient) {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
} // end isClient...
|
|
|
|
|
|
if (Meteor.isServer) {
|
|
|
Meteor.publish("documents", function () {
|
|
|
Meteor._debug("Publishing documents");
|
|
|
- return Documents.find({ isPrivate: false });
|
|
|
+ return Documents.find({
|
|
|
+ $or: [
|
|
|
+ { isPrivate: false },
|
|
|
+ { owner: this.userId }
|
|
|
+ ]
|
|
|
+ });
|
|
|
});
|
|
|
Meteor.publish("editingUsers", function () {
|
|
|
Meteor._debug("Publishing all editingUsers");
|