Skip to content

A platform for community discussion. Free, open, simple.

Rename `allow staff flags` to `allow flagging staff`

Robin Ward4dfe659189f0
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 7a97ab46226..4e2b817c0f8 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -1282,7 +1282,7 @@ en:
tl3_links_no_follow: "Do not remove rel=nofollow from links posted by trust level 3 users."
min_trust_to_create_topic: "The minimum trust level required to create a new topic."
- allow_staff_flags: "If enabled, users can flag posts from staff accounts."
+ allow_flagging_staff: "If enabled, users can flag posts from staff accounts."
min_trust_to_edit_wiki_post: "The minimum trust level required to edit post marked as wiki."
diff --git a/config/site_settings.yml b/config/site_settings.yml
index a10d7446eb6..64b71a2b344 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -900,7 +900,7 @@ trust:
min_trust_to_post_links:
default: 0
enum: 'TrustLevelSetting'
- allow_staff_flags: true
+ allow_flagging_staff: true
tl1_requires_topics_entered: 5
tl1_requires_read_posts:
default: 30
diff --git a/lib/guardian/post_guardian.rb b/lib/guardian/post_guardian.rb
index 3c822984f6d..aa92423b57c 100644
--- a/lib/guardian/post_guardian.rb
+++ b/lib/guardian/post_guardian.rb
@@ -22,7 +22,7 @@ module PostGuardian
result = if authenticated? && post && [email protected]?
# post made by staff, but we don't allow staff flags
- return false if !SiteSetting.allow_staff_flags? && post.user.staff?
+ return false if !SiteSetting.allow_flagging_staff? && post.user.staff?
return false if [:notify_user, :notify_moderators].include?(action_key) &&
!SiteSetting.enable_personal_messages?
diff --git a/spec/components/guardian_spec.rb b/spec/components/guardian_spec.rb
index cb9ad968aec..77667c4e014 100644
--- a/spec/components/guardian_spec.rb
+++ b/spec/components/guardian_spec.rb
@@ -71,14 +71,14 @@ describe Guardian do
expect(Guardian.new(user).post_can_act?(post, :spam)).to be_truthy
end
- it "allows flagging of staff posts when allow_staff_flags is true" do
- SiteSetting.allow_staff_flags = true
+ it "allows flagging of staff posts when allow_flagging_staff is true" do
+ SiteSetting.allow_flagging_staff = true
staff_post = Fabricate(:post, user: Fabricate(:moderator))
expect(Guardian.new(user).post_can_act?(staff_post, :spam)).to be_truthy
end
- it "doesn't allow flagging of staff posts when allow_staff_flags is false" do
- SiteSetting.allow_staff_flags = false
+ it "doesn't allow flagging of staff posts when allow_flagging_staff is false" do
+ SiteSetting.allow_flagging_staff = false
staff_post = Fabricate(:post, user: Fabricate(:moderator))
expect(Guardian.new(user).post_can_act?(staff_post, :spam)).to eq(false)
end