Ghost/ghost/admin/app/mixins/current-user-settings.js
2015-03-11 12:37:41 -06:00

33 lines
717 B
JavaScript

import Ember from 'ember';
var CurrentUserSettings = Ember.Mixin.create({
currentUser: function () {
return this.store.find('user', 'me');
},
transitionAuthor: function () {
var self = this;
return function (user) {
if (user.get('isAuthor')) {
return self.transitionTo('settings.users.user', user);
}
return user;
};
},
transitionEditor: function () {
var self = this;
return function (user) {
if (user.get('isEditor')) {
return self.transitionTo('settings.users');
}
return user;
};
}
});
export default CurrentUserSettings;