mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 19:52:01 +03:00
ed0ac32ebb
A signed in user with role author or editor will be redirected back to /ghost. closes #3292
25 lines
727 B
JavaScript
25 lines
727 B
JavaScript
import styleBody from 'ghost/mixins/style-body';
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
|
|
|
var DebugRoute = Ember.Route.extend(Ember.SimpleAuth.AuthenticatedRouteMixin, styleBody, loadingIndicator, {
|
|
classNames: ['settings'],
|
|
|
|
beforeModel: function () {
|
|
var self = this;
|
|
this.store.find('user', 'me').then(function (user) {
|
|
if (user.get('isAuthor') || user.get('isEditor')) {
|
|
self.transitionTo('posts');
|
|
}
|
|
});
|
|
},
|
|
|
|
model: function () {
|
|
return this.store.find('setting', { type: 'blog,theme' }).then(function (records) {
|
|
return records.get('firstObject');
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
export default DebugRoute;
|