From f9162d6addbbebb551fd67d90efea9b4cfc720ac Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 28 Jul 2014 11:59:46 +1000 Subject: [PATCH] FIX: moderators had no access to admin user page --- .../javascripts/admin/routes/admin_user_route.js | 12 +++++++----- .../admin/templates/user_index.js.handlebars | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/admin/routes/admin_user_route.js b/app/assets/javascripts/admin/routes/admin_user_route.js index efef6ddc4c4..5f1d4194059 100644 --- a/app/assets/javascripts/admin/routes/admin_user_route.js +++ b/app/assets/javascripts/admin/routes/admin_user_route.js @@ -25,11 +25,13 @@ Discourse.AdminUserIndexRoute = Discourse.Route.extend({ }, afterModel: function(model) { - var self = this; - return Discourse.Group.findAll().then(function(groups){ - self._availableGroups = groups.filterBy('automatic', false); - return model; - }); + if(Discourse.User.currentProp('admin')) { + var self = this; + return Discourse.Group.findAll().then(function(groups){ + self._availableGroups = groups.filterBy('automatic', false); + return model; + }); + } }, setupController: function(controller, model) { diff --git a/app/assets/javascripts/admin/templates/user_index.js.handlebars b/app/assets/javascripts/admin/templates/user_index.js.handlebars index 22d77122a8d..688b960136f 100644 --- a/app/assets/javascripts/admin/templates/user_index.js.handlebars +++ b/app/assets/javascripts/admin/templates/user_index.js.handlebars @@ -52,6 +52,8 @@ + + {{#if currentUser.admin}}
{{i18n admin.groups.title}}
@@ -68,6 +70,7 @@ {{/if}}
+ {{/if}}
{{i18n user.ip_address.title}}