mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: Export poll UI should only show for admins
This commit is contained in:
parent
532fea1460
commit
dbee72e92b
1 changed files with 2 additions and 1 deletions
|
@ -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",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue