mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 09:22:49 +03:00
4d074c3e55
Closes #3291 - Adds redirects based on roles as defined in the case - Adds new mixin `CurrentUserSettings` - For authors, all settings pages redirect to `users/self` - For editors, all settings pages other than specific users redirect to `users`. Any user that is not self or an author redirects to `users`
19 lines
641 B
JavaScript
19 lines
641 B
JavaScript
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
|
|
|
var SettingsGeneralRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, loadingIndicator, CurrentUserSettings, {
|
|
beforeModel: function () {
|
|
return this.currentUser()
|
|
.then(this.transitionAuthor())
|
|
.then(this.transitionEditor());
|
|
},
|
|
|
|
model: function () {
|
|
return this.store.find('setting', { type: 'blog,theme' }).then(function (records) {
|
|
return records.get('firstObject');
|
|
});
|
|
}
|
|
});
|
|
|
|
export default SettingsGeneralRoute;
|