FEATURE: allow category group moderators to edit posts (#11005)

* FEATURE: allow category group moderators to edit posts

If the `enable_category_group_moderation` SiteSetting is enabled, posts should be editable by those belonging to the appropraite groups.
This commit is contained in:
jbrw
2020-10-23 12:37:44 -04:00
committed by GitHub
parent 8a3a6face5
commit ce76553010
3 changed files with 21 additions and 17 deletions

View File

@ -448,21 +448,6 @@ describe PostsController do
expect(UserHistory.where(action: UserHistory.actions[:post_edit]).count).to eq(1)
end
it "can not update other posts within the primary category topic" do
second_post = Fabricate(:post, user: user, topic: topic)
put "/posts/#{second_post.id}.json", params: update_params
expect(response.status).to eq(403)
end
it "can not update other first posts of topics in the same category" do
second_topic_in_category = Fabricate(:topic, category: category)
post_in_second_topic = Fabricate(:post, user: user, topic: second_topic_in_category)
put "/posts/#{post_in_second_topic.id}.json", params: update_params
expect(response.status).to eq(403)
end
it "can not update category descriptions in other categories" do
second_category = Fabricate(:category)
topic.update!(category: second_category)