cleaned up router.js

This commit is contained in:
Yaman 2015-01-11 13:46:41 -05:00
parent bda83a494b
commit 965d889b26

View File

@ -19,14 +19,15 @@ Router.route('/login', function() {
});
Router.route('/admin', function() {
if (Meteor.user().roles[0]==='admin') {
if (Roles.userIsInRole(Meteor.userId(), ['admin'])) {
this.render("admin");
} else {
this.redirect('/checkout');
}
});
Router.route('/teacher', function() {
if (Meteor.user().roles[0]==='teacher') {
if (Roles.userIsInRole(Meteor.userId(), ['admin', 'teacher'])) {
this.render("teacher");
} else {
this.redirect('/checkout');