Only allow moderator to create polls

The Polls feature recently landed in the master branch and it’s awesome. As of now, Both moderator and non-moderator can create a poll but it would be great if it’s possible to restrict this functionality to moderator only.

Few snippets of poll feature

  1. create Polls screen

  2. *Add mulitple options

  3. can select multiple options at the same time

  4. Result after submit


And it would be nice if it’s allowed using a JWT flag too


Exactly, this is what I’m looking forward to.

for some reason, it’s not working for me (prosody don’t start saying that muc should be loaded as component). I had to do:

--- mod_polls.lua.old	2021-08-17 10:07:08.603800613 +0200
+++ mod_polls.lua	2021-08-17 09:35:19.492103033 +0200
@@ -6,7 +6,7 @@
 local st = require("util.stanza");
 local util = module:require("util");
-local muc = module:depends("muc");
+local get_room_from_jid = module:require "util".get_room_from_jid;
 local is_healthcheck_room = util.is_healthcheck_room;
@@ -57,7 +57,7 @@
 	local data = get_poll_message(event.stanza);
 	if data == nil then return end
-	local room = muc.get_room_from_jid(;
+	local room = get_room_from_jid(;
 	if data.type == "new-poll" then
 		if check_polls(room) then return end

This is with unstable and Ubuntu 20.04 LTS with its original Prosody version. Maybe it’s coming from me having installed the thing quite some time ago and not doing all necessary config updates.
Another possibility for update trouble is not having the prosody module loaded, the UI is available but polls are not - quite logically - seen from an user to another.

And well, about your question it does not seem possible yet and sites where users are unruly should disable the feature in the UI. Rome was not built in a day and so on.

Also, as of now we can select multiple options. Can we restrict it to one?

Agree, unless there is an on-boarding for moderators where the nature of the poll is defined.

Pick how the poll will work;
A. One selection or answer
B. Multiple choice

This would then allow for better management of output as most questions need only one answer or decision.

Good one. Thanks for sharing a nice piece of info.

by the way… is it possible only for moderators (logged in through jwt) to only start polls and see result of polls? Other users who are non-moderators should only be able to respond to polls and not see poll results.

Not yet I think.

I am sure there must be a way …no?
i.e. if moderators can only kickout other participants, then there must be a way for only moderators to start and see poll results

Adding @emrah and @Freddie in the conversation for a more clear picture.

This has been brought up a few times before, but I don’t think it’s on the priority list (I’m not even sure it’s on the roadmap at all). A ticket was opened sometime back to request it as a feature:

1 Like