fix: upgrade script

v1.18.x
Barış Soner Uşaklı 4 years ago
parent 59bbede8c7
commit 1289c10568

@ -60,14 +60,17 @@ module.exports = {
}); });
await db.delete('users:notvalidated'); await db.delete('users:notvalidated');
await updatePrivilges();
},
};
async function updatePrivilges() {
const cids = await db.getSortedSetRevRange('categories:cid', 0, -1);
const canChat = await privileges.global.canGroup('chat', 'registered-users');
// if email confirmation is required // if email confirmation is required
// give chat, posting privs to "verified-users" group // give chat, posting privs to "verified-users" group
// remove chat, posting privs from "registered-users" group // remove chat, posting privs from "registered-users" group
if (1 || meta.config.requireEmailConfirmation) { if (meta.config.requireEmailConfirmation) {
const cids = await db.getSortedSetRevRange('categories:cid', 0, -1);
const canChat = await privileges.global.canGroup('chat', 'registered-users');
if (canChat) { if (canChat) {
await privileges.global.give(['groups:chat'], 'verified-users'); await privileges.global.give(['groups:chat'], 'verified-users');
await privileges.global.rescind(['groups:chat'], 'registered-users'); await privileges.global.rescind(['groups:chat'], 'registered-users');
@ -89,5 +92,4 @@ module.exports = {
} }
} }
} }
}, }
};

Loading…
Cancel
Save