Ghost/ghost/admin/tests/helpers/members.js
Rishabh Garg da62355e18
Wired email alert settings for staff users on admin (#15313)
refs TryGhost/Team#1826

- allows staff users to manage their email alert settings behind the flag
- only owner and admin users are able to toggle their email alerts
2022-08-25 15:47:14 +05:30

16 lines
801 B
JavaScript

export function enableMembers(server) {
server.db.settings.find({key: 'members_signup_access'})
? server.db.settings.update({key: 'members_signup_access'}, {value: 'all'})
: server.create('setting', {key: 'members_signup_access', value: 'all', group: 'members'});
server.db.settings.find({key: 'members_enabled'})
? server.db.settings.update({key: 'members_enabled'}, {value: true})
: server.create('setting', {key: 'members_enabled', value: true, group: 'members'});
}
export function disableMembers(server) {
server.db.settings.find({key: 'members_signup_access'})
? server.db.settings.update({key: 'members_signup_access'}, {value: 'none'})
: server.create('setting', {key: 'members_signup_access', value: 'none', group: 'members'});
}