2014-07-25 00:52:17 -07:00
|
|
|
var CurrentUserSettings = Ember.Mixin.create({
|
2014-10-24 21:09:50 +00:00
|
|
|
currentUser: function () {
|
|
|
|
return this.store.find('user', 'me');
|
|
|
|
},
|
2014-07-25 00:52:17 -07:00
|
|
|
|
2014-10-24 21:09:50 +00:00
|
|
|
transitionAuthor: function () {
|
|
|
|
var self = this;
|
2014-07-25 00:52:17 -07:00
|
|
|
|
2014-10-24 21:09:50 +00:00
|
|
|
return function (user) {
|
|
|
|
if (user.get('isAuthor')) {
|
|
|
|
return self.transitionTo('settings.users.user', user);
|
|
|
|
}
|
2014-07-25 00:52:17 -07:00
|
|
|
|
2014-10-24 21:09:50 +00:00
|
|
|
return user;
|
|
|
|
};
|
|
|
|
},
|
2014-07-25 00:52:17 -07:00
|
|
|
|
2014-10-24 21:09:50 +00:00
|
|
|
transitionEditor: function () {
|
|
|
|
var self = this;
|
2014-07-25 00:52:17 -07:00
|
|
|
|
2014-10-24 21:09:50 +00:00
|
|
|
return function (user) {
|
|
|
|
if (user.get('isEditor')) {
|
|
|
|
return self.transitionTo('settings.users');
|
|
|
|
}
|
2014-07-25 00:52:17 -07:00
|
|
|
|
2014-10-24 21:09:50 +00:00
|
|
|
return user;
|
|
|
|
};
|
|
|
|
}
|
2014-07-25 00:52:17 -07:00
|
|
|
});
|
|
|
|
|
2014-10-24 21:09:50 +00:00
|
|
|
export default CurrentUserSettings;
|