nodebb-plugin-poll 4.0.15 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +7 -7
- package/LICENSE +20 -20
- package/README.md +46 -0
- package/eslint.config.mjs +7 -0
- package/languages/cs/poll.json +0 -0
- package/languages/en_GB/poll.json +1 -0
- package/languages/en_US/poll.json +0 -0
- package/languages/fr/poll.json +0 -0
- package/languages/ru/poll.json +0 -0
- package/lib/config.js +0 -0
- package/lib/hooks.js +231 -0
- package/lib/nodebb.js +0 -0
- package/lib/poll.js +102 -0
- package/lib/sockets.js +109 -2
- package/lib/vote.js +4 -0
- package/library.js +0 -0
- package/package-lock.json +1658 -0
- package/package.json +2 -2
- package/plugin.json +2 -0
- package/public/js/admin.js +0 -0
- package/public/js/poll/creator.js +5 -0
- package/public/js/poll/main.js +0 -0
- package/public/js/poll/view.js +6 -2
- package/templates/admin/plugins/poll.tpl +0 -0
- package/templates/poll/creator.tpl +1 -0
- package/test/helpers.js +49 -0
- package/test/index.js +530 -0
- package/upgrades/fix_incorrect_poll_privilege.js +15 -15
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const db = nodebb.require('./src/database');
|
|
4
|
-
const privileges = nodebb.require('./src/privileges');
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
name: 'Fix incorrectly given poll privilege',
|
|
8
|
-
timestamp: Date.UTC(2020, 9, 29),
|
|
9
|
-
method: async () => {
|
|
10
|
-
const cids = await db.getSortedSetRange('categories:cid', 0, -1);
|
|
11
|
-
await Promise.all(cids.map(async (cid) => {
|
|
12
|
-
await privileges.categories.rescind(['poll:create'], cid, ['registered-users']);
|
|
13
|
-
}));
|
|
14
|
-
},
|
|
15
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const db = nodebb.require('./src/database');
|
|
4
|
+
const privileges = nodebb.require('./src/privileges');
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
name: 'Fix incorrectly given poll privilege',
|
|
8
|
+
timestamp: Date.UTC(2020, 9, 29),
|
|
9
|
+
method: async () => {
|
|
10
|
+
const cids = await db.getSortedSetRange('categories:cid', 0, -1);
|
|
11
|
+
await Promise.all(cids.map(async (cid) => {
|
|
12
|
+
await privileges.categories.rescind(['poll:create'], cid, ['registered-users']);
|
|
13
|
+
}));
|
|
14
|
+
},
|
|
15
|
+
};
|