nodebb-plugin-poll
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -46,3 +46,4 @@ { | ||
"vote_count": "users voted for this option", | ||
"votes": "votes" | ||
"votes": "votes", | ||
"admin.create-poll": "Create Poll" | ||
} |
'use strict'; | ||
const NodeBB = require('./lib/nodebb'); | ||
const NodeBB = require('./lib/nodebb'); | ||
const Config = require('./lib/config'); | ||
@@ -49,17 +49,8 @@ const Sockets = require('./lib/sockets'); | ||
Plugin.addUserPrivilege = function (privileges, callback) { | ||
privileges.push('poll:create'); | ||
callback(null, privileges); | ||
Plugin.addPrivilege = function (hookData) { | ||
hookData.privileges.set( | ||
'poll:create', { label: '[[poll:admin.create-poll]]' }, | ||
); | ||
}; | ||
Plugin.addPrivilegeLabels = function (labels, callback) { | ||
labels.push({ name: 'Create Poll' }); | ||
callback(null, labels); | ||
}; | ||
Plugin.addGroupPrivilege = function (privileges, callback) { | ||
privileges.push('groups:poll:create'); | ||
callback(null, privileges); | ||
}; | ||
Plugin.copyPrivilegesFrom = function (data, callback) { | ||
@@ -66,0 +57,0 @@ if (data.privileges.indexOf('poll:create') === -1) { |
{ | ||
"name": "nodebb-plugin-poll", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "NodeBB Poll Plugin", | ||
@@ -5,0 +5,0 @@ "main": "library.js", |
@@ -11,9 +11,4 @@ { | ||
{ "hook": "filter:composer.formatting", "method": "registerFormatting" }, | ||
{ "hook": "filter:privileges.list", "method": "addUserPrivilege" }, | ||
{ "hook": "filter:privileges.groups.list", "method": "addGroupPrivilege" }, | ||
{ "hook": "filter:privileges.list_human", "method": "addPrivilegeLabels" }, | ||
{ "hook": "filter:privileges.groups.list_human", "method": "addPrivilegeLabels" }, | ||
{ "hook": "static:privileges.categories.init", "method": "addPrivilege" }, | ||
{ "hook": "filter:categories.copyPrivilegesFrom", "method": "copyPrivilegesFrom" }, | ||
{ "hook": "filter:topic.post", "method": "hooks.filter.topicPost" }, | ||
@@ -20,0 +15,0 @@ { "hook": "filter:parse.raw", "method": "hooks.filter.parseRaw", "priority": 1 }, |
218429
2479