Permalink
Browse files

My tweak to step 11 of the tutorial - allow only task owner to check …

…off and remove her tasks (not only for private tasks)
  • Loading branch information...
itamaro committed Nov 28, 2015
1 parent 6bbc835 commit 6c8740407d670f36a53c9c87b11ad2f60fc2244e
Showing with 2 additions and 2 deletions.
  1. +2 −2 simple-todos-react.jsx
@@ -44,7 +44,7 @@ Meteor.methods({
removeTask(taskId) {
const task = Tasks.findOne(taskId);
if (task.private && task.owner !== Meteor.userId()) {
if (task.owner && task.owner !== Meteor.userId()) {
// If the task is private, make sure only the owner can delete it
throw new Meteor.Error("not-authorized");
}
@@ -53,7 +53,7 @@ Meteor.methods({
setChecked(taskId, setChecked) {
const task = Tasks.findOne(taskId);
if (task.private && task.owner !== Meteor.userId()) {
if (task.owner && task.owner !== Meteor.userId()) {
// If the task is private, make sure only the owner can check it off
throw new Meteor.Error("not-authorized");
}

0 comments on commit 6c87404

Please sign in to comment.