mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 09:52:09 +03:00
04760132e9
no issue - having owner-only access control in the template meant the route was accessible but would show a blank page - updated access control in the `members-payments` route to redirect admins to the settings index screen and non-admins to the default home screen
31 lines
989 B
JavaScript
31 lines
989 B
JavaScript
/* eslint-disable ghost/ember/alias-model-in-controller */
|
|
import Controller from '@ember/controller';
|
|
import {inject as service} from '@ember/service';
|
|
import {task} from 'ember-concurrency';
|
|
|
|
export default Controller.extend({
|
|
settings: service(),
|
|
|
|
actions: {
|
|
setDefaultContentVisibility(value) {
|
|
this.set('settings.defaultContentVisibility', value);
|
|
},
|
|
|
|
setStripeConnectIntegrationTokenSetting(stripeConnectIntegrationToken) {
|
|
this.set('settings.stripeConnectIntegrationToken', stripeConnectIntegrationToken);
|
|
}
|
|
},
|
|
|
|
saveSettings: task(function* () {
|
|
const response = yield this.settings.save();
|
|
// Reset from address value on save
|
|
return response;
|
|
}).drop(),
|
|
|
|
reset() {
|
|
// stripeConnectIntegrationToken is not a persisted value so we don't want
|
|
// to keep it around across transitions
|
|
this.settings.set('stripeConnectIntegrationToken', undefined);
|
|
}
|
|
});
|