mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FIX: Export poll UI should only show for admins
This commit is contained in:
@ -630,6 +630,7 @@ createWidget("discourse-poll-buttons", {
|
|||||||
const closed = attrs.isClosed;
|
const closed = attrs.isClosed;
|
||||||
const staffOnly = poll.results === "staff_only";
|
const staffOnly = poll.results === "staff_only";
|
||||||
const isStaff = this.currentUser && this.currentUser.staff;
|
const isStaff = this.currentUser && this.currentUser.staff;
|
||||||
|
const isAdmin = this.currentUser && this.currentUser.admin;
|
||||||
const dataExplorerEnabled = this.siteSettings.data_explorer_enabled;
|
const dataExplorerEnabled = this.siteSettings.data_explorer_enabled;
|
||||||
const hideResultsDisabled = !staffOnly && (closed || topicArchived);
|
const hideResultsDisabled = !staffOnly && (closed || topicArchived);
|
||||||
const exportQueryID = this.siteSettings.poll_export_data_explorer_query_id;
|
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(
|
contents.push(
|
||||||
this.attach("button", {
|
this.attach("button", {
|
||||||
className: "btn btn-default export-results",
|
className: "btn btn-default export-results",
|
||||||
|
Reference in New Issue
Block a user