0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-14 13:58:53 +08:00
discourse/plugins/discourse-assign/test/javascripts/fixtures/topic-with-assigned-posts.js
Mark VanLandingham 2aaa6a5ca3
FEATURE: Add category-level assignment permissions (#40412)
Previously, assignment permissions only came from the global
`assign_allowed_on_groups` site setting.

This change lets categories grant assignment permission to additional
groups, keeping assignment controls and assignee suggestions scoped to
the relevant category.
2026-06-08 09:59:40 -05:00

30 lines
788 B
JavaScript
Vendored

import { cloneJSON } from "discourse/lib/object";
import topicFixtures from "discourse/tests/fixtures/topic";
export default function topicWithAssignedPosts() {
const username = "eviltrout";
const topic = cloneJSON(topicFixtures["/t/28830/1.json"]);
const firstReply = topic.post_stream.posts[1];
const secondReply = topic.post_stream.posts[2];
firstReply["can_assign"] = true;
secondReply["can_assign"] = true;
topic["indirectly_assigned_to"] = {
[firstReply.id]: {
assigned_to: {
username,
},
post_number: 1,
},
[secondReply.id]: {
assigned_to: {
username,
},
post_number: 2,
},
};
firstReply["assigned_to_user"] = { username };
secondReply["assigned_to_user"] = { username };
return topic;
}