This repository has been archived on 2025-03-30. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
hymenobacterdotinfo/app/pods/protected/users/index/route.js

19 lines
414 B
JavaScript

import Ember from 'ember';
export default Ember.Route.extend({
currentUser: Ember.inject.service('session-account'),
beforeModel: function(transition) {
this._super(transition);
this.get('currentUser.account').then((user) => {
if (!user.get('isAdmin')) {
this.transitionTo('protected.index');
}
});
},
model: function() {
return this.store.findAll('user');
},
});