FIX: moderators had no access to admin user page

This commit is contained in:
Sam 2014-07-28 11:59:46 +10:00
parent 32cea9d8cc
commit f9162d6add
2 changed files with 10 additions and 5 deletions

View File

@ -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) {

View File

@ -52,6 +52,8 @@
</div>
</div>
{{#if currentUser.admin}}
<div class='display-row'>
<div class='field'>{{i18n admin.groups.title}}</div>
<div class='value'>
@ -68,6 +70,7 @@
{{/if}}
</div>
</div>
{{/if}}
<div class='display-row'>
<div class='field'>{{i18n user.ip_address.title}}</div>