Skip to content

A platform for community discussion. Free, open, simple.

FIX: all staff members (regardless of TL) should be able to pin/unpin topics (#12435)

jbrwaaf96edee067
diff --git a/app/assets/javascripts/discourse/app/controllers/feature-topic.js b/app/assets/javascripts/discourse/app/controllers/feature-topic.js
index f53288b4cad..f723df6f3b8 100644
--- a/app/assets/javascripts/discourse/app/controllers/feature-topic.js
+++ b/app/assets/javascripts/discourse/app/controllers/feature-topic.js
@@ -49,7 +49,7 @@ export default Controller.extend(ModalFunctionality, {
@discourseComputed("model.details.can_pin_unpin_topic")
canPinGlobally(canPinUnpinTopic) {
- return this.currentUser.isElder && canPinUnpinTopic;
+ return this.currentUser.canManageTopic && canPinUnpinTopic;
},
@discourseComputed("categoryLink")
diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-test.js
index 7a5ab8f83c8..3da084abb35 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-test.js
@@ -481,6 +481,27 @@ acceptance("Topic pinning/unpinning as an admin", function (needs) {
});
});
+acceptance("Topic pinning/unpinning as a staff member", function (needs) {
+ needs.user({ moderator: true, admin: false, trust_level: 2 });
+
+ test("Staff pinning topic", async function (assert) {
+ await visit("/t/topic-for-group-moderators/2480");
+
+ await click(".toggle-admin-menu");
+ await click(".topic-admin-pin .btn");
+
+ assert.ok(
+ exists(".feature-topic .btn-primary"),
+ "it should show the 'Pin Topic' button"
+ );
+
+ assert.ok(
+ exists(".make-banner"),
+ "it should show the 'Banner Topic' button"
+ );
+ });
+});
+
acceptance("Topic pinning/unpinning as a group moderator", function (needs) {
needs.user({ moderator: false, admin: false, trust_level: 1 });