From 93f8b3489e4048b4a63f706027cc063ff3e17c63 Mon Sep 17 00:00:00 2001 From: Yaman Qalieh Date: Tue, 16 Aug 2016 06:15:15 -0400 Subject: [PATCH] routing for admin page --- hourglass/lib/router.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hourglass/lib/router.js b/hourglass/lib/router.js index 218a7d1..b10d61a 100644 --- a/hourglass/lib/router.js +++ b/hourglass/lib/router.js @@ -24,6 +24,14 @@ Router.route('/profile', function() { } }); +Router.route('/admin', function() { + if (Roles.userIsInRole(Meteor.userId(), ['admin', 'superadmin'])) { + this.render("admin"); + } else { + this.redirect('/login'); + } +}); + Router.configure({ notFoundTemplate: "NotFound" });