This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
hymenobacterdotinfo/app/pods/protected/users/index/route.js
2015-09-09 16:49:48 -07:00

17 lines
357 B
JavaScript

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