mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: TL4 users cannot unhide posts. (#13211)
"PostsGuardian#can_unhide_post?" only returns true if the user is a staff member. We shouldn't let TL4 users see the Unhide post button.
This commit is contained in:
parent
869518e3d2
commit
9ecd17b083
@ -65,7 +65,7 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attrs.canManage && attrs.hidden) {
|
if (currentUser.staff && attrs.hidden) {
|
||||||
contents.push({
|
contents.push({
|
||||||
icon: "far-eye",
|
icon: "far-eye",
|
||||||
label: "post.controls.unhide",
|
label: "post.controls.unhide",
|
||||||
|
@ -734,6 +734,7 @@ discourseModule("Integration | Component | Widget | post", function (hooks) {
|
|||||||
{{mount-widget widget="post" args=args unhidePost=unhidePost}}
|
{{mount-widget widget="post" args=args unhidePost=unhidePost}}
|
||||||
`,
|
`,
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
|
this.currentUser.admin = true;
|
||||||
this.set("args", { canManage: true, hidden: true });
|
this.set("args", { canManage: true, hidden: true });
|
||||||
this.set("unhidePost", () => (this.unhidden = true));
|
this.set("unhidePost", () => (this.unhidden = true));
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user