From 09dd53fb6fbae9558d104c707dc652e27b132604 Mon Sep 17 00:00:00 2001 From: Yaman Qalieh Date: Sat, 3 Sep 2016 21:12:17 -0400 Subject: [PATCH] edit createWork to allow personal work to be created --- hourglass/server/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hourglass/server/main.js b/hourglass/server/main.js index e5636f9..ed36878 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -311,8 +311,9 @@ Meteor.methods({ }); if (Meteor.user() && - found && _.contains(Meteor.user().profile.classes, input.class) && - found.banned.indexOf(Meteor.userId()) === -1 && + ((found && _.contains(Meteor.user().profile.classes, input.class) && + !_.contains(found.banned, Meteor.userId())) || + (Meteor.userId() === input.class)) && input.dueDate instanceof Date && input.dueDate.getTime() >= ref && _.contains(worktype, input.type) && input.name.length <= 50 && input.description.length <= 150) {