#217: now isAdmin router check call this.subscribe().wait() to avoid showing 'You have to be an admin' message to admins

This commit is contained in:
Egor Suvorov 2014-01-06 21:01:21 +02:00
parent 492bf22d30
commit 088c2a1127

View file

@ -131,6 +131,8 @@ var filters = {
},
isAdmin: function() {
this.subscribe('currentUser').wait();
if(!this.ready()) return;
if(!Meteor.loggingIn() && Session.get('settingsLoaded') && !isAdmin()){
throwError(i18n.t("Sorry, you have to be an admin to view this page."))
this.render('no_rights');