35 lines
690 B
JavaScript
Raw Normal View History

2014-12-23 21:09:30 -05:00
Router.route('/', function() {
2015-01-01 02:20:24 -05:00
this.render("initial");
2014-12-23 21:09:30 -05:00
})
2014-12-25 17:42:54 -05:00
Router.route('/checkout', function() {
2015-01-01 02:20:24 -05:00
if (Meteor.user()) {
this.render("checkout");
} else {
this.redirect('/login');
}
2014-12-25 17:42:54 -05:00
});
2014-12-25 17:42:54 -05:00
Router.route('/login', function() {
2015-01-01 02:20:24 -05:00
if (Meteor.user()) {
this.redirect('/checkout');
} else {
this.render("login");
}
});
Router.route('/admin', function() {
2015-01-12 21:34:41 -05:00
if (Roles.userIsInRole(Meteor.userId(), ['admin'])) {
2015-01-01 02:20:24 -05:00
this.render("admin");
2015-01-12 21:34:41 -05:00
} else {
2015-01-11 13:50:36 -05:00
this.redirect('/login');
2015-01-12 21:34:41 -05:00
}
2015-01-11 13:39:10 -05:00
});
2015-01-11 13:46:41 -05:00
2015-01-11 13:39:10 -05:00
Router.route('/teacher', function() {
2015-01-12 21:34:41 -05:00
if (Roles.userIsInRole(Meteor.userId(), ['admin', 'teacher'])) {
2015-01-11 13:39:10 -05:00
this.render("teacher");
2015-01-12 21:34:41 -05:00
} else {
2015-01-11 15:02:46 -05:00
this.redirect('/login');
2015-01-12 21:34:41 -05:00
}
2014-12-25 17:42:54 -05:00
});