From f6a54662e9ae8b961754417770366408e5f641ad Mon Sep 17 00:00:00 2001 From: Manu S Ajith Date: Fri, 5 Jun 2015 09:35:43 +0530 Subject: [PATCH] Fix bug - check ownership of job post before editing Signed-off-by: Manu S Ajith --- router.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/router.js b/router.js index 030a2fd..e487037 100644 --- a/router.js +++ b/router.js @@ -120,6 +120,13 @@ Router.map(function() { }, waitOn: function() { return subs.subscribe("job", this.params._id); + }, + onBeforeAction: function() { + if (this.data.userId !== Meteor.userId()) { + this.redirect("jobs") + } else { + this.next(); + } } });