update router for admin page
This commit is contained in:
parent
e2a38adee2
commit
9c63a46409
@ -47,13 +47,24 @@ Router.route('/profile', {
|
||||
});
|
||||
|
||||
Router.route('/admin', function() {
|
||||
if (Roles.userIsInRole(Meteor.userId(), ['admin', 'superadmin'])) {
|
||||
waitOn: function() {
|
||||
if (Roles.userIsInRole(Meteor.userId(), ['admin', 'superadmin'])) {
|
||||
return [
|
||||
Meteor.subscribe('classes',this.params._id),
|
||||
Meteor.subscribe('schools',this.params._id),
|
||||
Meteor.subscribe('work',this.params._id),
|
||||
Meteor.subscribe('requests',this.params._id),
|
||||
Meteor.subscribe('users',this.params._id)
|
||||
];
|
||||
} else {
|
||||
this.render('NotFound');
|
||||
}
|
||||
},
|
||||
action: function() {
|
||||
this.render("admin");
|
||||
} else {
|
||||
this.redirect('/login');
|
||||
}
|
||||
});
|
||||
|
||||
Router.configure({
|
||||
notFoundTemplate: "NotFound"
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user