mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
e6fd1b89c0
Refs #4750 - Make "Feature" a Controller with promise support. - Use via 'needs' instead of injecting from an initializer because we need authenticated access to the API. - Check whether feature is enabled when entering Code Injection route.
24 lines
1.2 KiB
JavaScript
24 lines
1.2 KiB
JavaScript
var SettingsController = Ember.Controller.extend({
|
|
needs: ['feature'],
|
|
|
|
showGeneral: Ember.computed('session.user.name', function () {
|
|
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true;
|
|
}),
|
|
showUsers: Ember.computed('session.user.name', function () {
|
|
return this.get('session.user.isAuthor') ? false : true;
|
|
}),
|
|
showTags: Ember.computed('session.user.name', 'controllers.feature.tagsUI', function () {
|
|
return this.get('session.user.isAuthor') || !this.get('controllers.feature.tagsUI') ? false : true;
|
|
}),
|
|
showCodeInjection: Ember.computed('session.user.name', 'controllers.feature.codeInjectionUI', function () {
|
|
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') || !this.get('controllers.feature.codeInjectionUI') ? false : true;
|
|
}),
|
|
showLabs: Ember.computed('session.user.name', function () {
|
|
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true;
|
|
}),
|
|
showAbout: Ember.computed('session.user.name', function () {
|
|
return this.get('session.user.isAuthor') ? false : true;
|
|
})
|
|
});
|
|
|
|
export default SettingsController;
|