mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
Merge pull request #3376 from felixrieseberg/iss3292
Redirect authors and editors away from debug page
This commit is contained in:
commit
f3899aaefe
@ -4,11 +4,21 @@ 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;
|
||||
|
Loading…
Reference in New Issue
Block a user