Rename allow staff flags to allow flagging staff

This commit is contained in:
Robin Ward 2018-02-12 15:27:05 -05:00
parent 32116654ec
commit 4dfe659189
4 changed files with 7 additions and 7 deletions

View File

@ -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."

View File

@ -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

View File

@ -22,7 +22,7 @@ module PostGuardian
result = if authenticated? && post && !@user.anonymous?
# 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?

View File

@ -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