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
2015-11-05 17:48:58 -07:00

21 lines
442 B
JavaScript

import Ember from 'ember';
const { Route, inject: { service } } = Ember;
export default Route.extend({
currentUser: 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');
},
});