mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
Merge pull request #3376 from felixrieseberg/iss3292
Redirect authors and editors away from debug page
This commit is contained in:
commit
81cd617741
1 changed files with 10 additions and 0 deletions
|
@ -4,11 +4,21 @@ import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||||
var DebugRoute = Ember.Route.extend(Ember.SimpleAuth.AuthenticatedRouteMixin, styleBody, loadingIndicator, {
|
var DebugRoute = Ember.Route.extend(Ember.SimpleAuth.AuthenticatedRouteMixin, styleBody, loadingIndicator, {
|
||||||
classNames: ['settings'],
|
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 () {
|
model: function () {
|
||||||
return this.store.find('setting', { type: 'blog,theme' }).then(function (records) {
|
return this.store.find('setting', { type: 'blog,theme' }).then(function (records) {
|
||||||
return records.get('firstObject');
|
return records.get('firstObject');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default DebugRoute;
|
export default DebugRoute;
|
||||||
|
|
Loading…
Add table
Reference in a new issue