A platform for community discussion. Free, open, simple.
FIX: Export poll UI should only show for admins
Rafael dos Santos Silvadbee72e92bb4
diff --git a/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 b/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6index 9fd47d51070..402f4519e11 100644--- a/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6+++ b/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6@@ -630,6 +630,7 @@ createWidget("discourse-poll-buttons", {const closed = attrs.isClosed;const staffOnly = poll.results === "staff_only";const isStaff = this.currentUser && this.currentUser.staff;+ const isAdmin = this.currentUser && this.currentUser.admin;const dataExplorerEnabled = this.siteSettings.data_explorer_enabled;const hideResultsDisabled = !staffOnly && (closed || topicArchived);const exportQueryID = this.siteSettings.poll_export_data_explorer_query_id;@@ -682,7 +683,7 @@ createWidget("discourse-poll-buttons", {}}- if (isStaff && dataExplorerEnabled && poll.voters > 0 && exportQueryID) {+ if (isAdmin && dataExplorerEnabled && poll.voters > 0 && exportQueryID) {contents.push(this.attach("button", {className: "btn btn-default export-results",