|
@@ -46,5 +46,16 @@ Meteor.methods({
|
|
// Without checking user ?
|
|
// Without checking user ?
|
|
Meteor._debug("setCheck", taskId, setChecked);
|
|
Meteor._debug("setCheck", taskId, setChecked);
|
|
Tasks.update(taskId, { $set: { checked: setChecked }});
|
|
Tasks.update(taskId, { $set: { checked: setChecked }});
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ setPrivate(taskId, setToPrivate) {
|
|
|
|
+ const task = Tasks.findOne(taskId);
|
|
|
|
+
|
|
|
|
+ // Make sure only the task owneer can make a task private.
|
|
|
|
+ if (task.owner !== Meteor.userId()) {
|
|
|
|
+ throw new Meteor.Error("not-authorized");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Tasks.update(taskId, { $set: { private: setToPrivate }});
|
|
}
|
|
}
|
|
});
|
|
});
|