mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Make post notices invisible to poster.
This commit is contained in:
@@ -370,7 +370,7 @@ class PostSerializer < BasicPostSerializer
|
|||||||
end
|
end
|
||||||
|
|
||||||
def include_post_notice_type?
|
def include_post_notice_type?
|
||||||
return false if scope.user&.id != object.user_id && !scope.user&.has_trust_level?(TrustLevel[2])
|
return false if scope.user&.id == object.user_id || !scope.user&.has_trust_level?(TrustLevel[2])
|
||||||
|
|
||||||
post_notice_type.present?
|
post_notice_type.present?
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ describe PostSerializer do
|
|||||||
|
|
||||||
it "will not show for poster and TL2+ users" do
|
it "will not show for poster and TL2+ users" do
|
||||||
expect(json_for_user(nil)[:post_notice_type]).to eq(nil)
|
expect(json_for_user(nil)[:post_notice_type]).to eq(nil)
|
||||||
expect(json_for_user(user)[:post_notice_type]).to eq("returning")
|
expect(json_for_user(user)[:post_notice_type]).to eq(nil)
|
||||||
expect(json_for_user(user_tl1)[:post_notice_type]).to eq(nil)
|
expect(json_for_user(user_tl1)[:post_notice_type]).to eq(nil)
|
||||||
expect(json_for_user(user_tl2)[:post_notice_type]).to eq("returning")
|
expect(json_for_user(user_tl2)[:post_notice_type]).to eq("returning")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user