Przeglądaj źródła

Commit 11.5: Define helper to check ownership.

Frederic G. MARAND 8 lat temu
rodzic
commit
bc47d10db5
1 zmienionych plików z 6 dodań i 0 usunięć
  1. 6 0
      simple-todos.js

+ 6 - 0
simple-todos.js

@@ -53,6 +53,12 @@ if (Meteor.isClient) {
     }
   });
 
+  Template.task.helpers({
+    isOwner: function () {
+      return this.owner === Meteor.userId();
+    }
+  });
+
   Template.task.events({
     'click .delete': function (e) {
       Meteor.call('deleteTask', this._id);