mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 11:11:13 +08:00
FEATURE: Support designating multiple groups as mods on category (#28655)
Currently, categories support designating only 1 group as a moderation group on the category. This commit removes the one group limitation and makes it possible to designate multiple groups as mods on a category. Internal topic: t/124648.
This commit is contained in:
@ -83,7 +83,7 @@ RSpec.describe TopicGuardian do
|
||||
it "returns true for group moderator" do
|
||||
SiteSetting.enable_category_group_moderation = true
|
||||
expect(Guardian.new(user).can_see_deleted_topics?(topic.category)).to eq(false)
|
||||
category.update!(reviewable_by_group_id: group.id)
|
||||
Fabricate(:category_moderation_group, category:, group:)
|
||||
group.add(user)
|
||||
topic.update!(category: category)
|
||||
expect(Guardian.new(user).can_see_deleted_topics?(topic.category)).to eq(true)
|
||||
@ -110,7 +110,7 @@ RSpec.describe TopicGuardian do
|
||||
it "returns true for group moderator" do
|
||||
SiteSetting.enable_category_group_moderation = true
|
||||
expect(Guardian.new(user).can_recover_topic?(Topic.with_deleted.last)).to eq(false)
|
||||
category.update!(reviewable_by_group_id: group.id)
|
||||
Fabricate(:category_moderation_group, category:, group:)
|
||||
group.add(user)
|
||||
topic.update!(category: category)
|
||||
expect(Guardian.new(user).can_recover_topic?(Topic.with_deleted.last)).to eq(true)
|
||||
@ -255,7 +255,7 @@ RSpec.describe TopicGuardian do
|
||||
it "returns the topic ids for topics which are deleted but user is a category moderator of" do
|
||||
SiteSetting.enable_category_group_moderation = true
|
||||
|
||||
category.update!(reviewable_by_group_id: group.id)
|
||||
Fabricate(:category_moderation_group, category:, group:)
|
||||
group.add(user)
|
||||
topic.update!(category: category)
|
||||
topic.trash!(admin)
|
||||
|
Reference in New Issue
Block a user