Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ function registerTopicFooterButtons(api) {
},

displayed() {
return !this.site.mobileView && this.topic.isAssigned();
return (
this.get("currentUser.can_assign") &&
!this.site.mobileView &&
this.topic.isAssigned()
);
},
});

Expand Down
11 changes: 11 additions & 0 deletions test/javascripts/acceptance/assigned-topic-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ acceptance("Discourse Assign | Assigned topic", function (needs) {
assign_enabled: true,
tagging_enabled: true,
assigns_user_url_path: "/",
assigns_public: true,
});

assignCurrentUserToTopic(needs);
Expand Down Expand Up @@ -123,6 +124,16 @@ acceptance("Discourse Assign | Assigned topic", function (needs) {
"shows reassign dropdown at the bottom of the topic"
);
});

test("User without assign ability cannot see footer button", async (assert) => {
updateCurrentUser({ can_assign: false, admin: false, moderator: false });
await visit("/t/assignment-topic/45");

assert.notOk(
exists("#topic-footer-dropdown-reassign"),
"does not show reassign dropdown at the bottom of the topic"
);
});
});

acceptance("Discourse Assign | Re-assign topic", function (needs) {
Expand Down