I searched and saw some discussion on this, but it seems no solution exists (and the topic was more about edited polls rather than removing them).
On our forum, we’ve come across an interesting scenario in which a user no longer wants a poll in their post. This is because they are changing the format of the post from a feature request into a support inquiry. They’re not able to delete the poll in their post, so they flagged it asking for moderators to do so… and then I discovered that moderators cannot either. I get a message saying “You cannot add, remove or rename polls after the first 5 minutes” instead.
Is there a permission to allow moderators to remove polls from posts? If not, can this be implemented/enabled?
After testing (thanks for the link @Lilly_S) I can confirm that the poll edit window mins appears to apply to site staff in addition to regular users. Further, the poll edit window mins appears to prevent removal of polls in addition to edits. I think we should:
Ensure that staff are not affected by the poll edit window mins site setting.
Ensure that poll edit window mins only applies to edits, so regular users can remove polls even after the poll edit window.
@tgxworld looking at the git blame here, it looks like you authored most of the security checks there.
I can also see: if User.staff.pluck(:id).include?(post.last_editor_id) which we probably want to change to if User.staff.where(id: post.last_editor_id).exists? or something
I can see that staff are denied option changes after edit window, but should they also be denied complete poll removal?
haha this is because all the code used to be in plugin.rb and I re-organized the code into individual files during a refactor so every line is going to point at me XD
Fixed in
I’m not sure about this because we had specific guards in place to prevent this. It has been 2 years since the guards were added but maybe @zogstrip would remember why we did so?
Regarding this, I don’t know why the edit window was being applied to the additional/removal and rename of polls because a user should be free to edit his own post. I’ve removed the guard in