FIX: Posting without bump raised an error for TL4

FIX: Posting without bump raised an error for TL4

diff --git a/lib/guardian/post_guardian.rb b/lib/guardian/post_guardian.rb
index d30db19..0163496 100644
--- a/lib/guardian/post_guardian.rb
+++ b/lib/guardian/post_guardian.rb
@@ -267,6 +267,6 @@ module PostGuardian
   end
 
   def can_skip_bump?
-    is_staff?
+    is_staff? || @user.has_trust_level?(TrustLevel[4])
   end
 end
diff --git a/spec/requests/posts_controller_spec.rb b/spec/requests/posts_controller_spec.rb
index 8290e1b..63f9ba8 100644
--- a/spec/requests/posts_controller_spec.rb
+++ b/spec/requests/posts_controller_spec.rb
@@ -1160,10 +1160,18 @@ describe PostsController do
         include_examples "it works"
       end
 
+      context "TL4 users" do
+        before do
+          sign_in(Fabricate(:trust_level_4))
+        end
+
+        include_examples "it works"
+      end
+
       context "users" do
         let(:topic) { Fabricate(:topic) }
 
-        [:user, :trust_level_4].each do |user|
+        [:user].each do |user|
           it "will raise an error for #{user}" do
             sign_in(Fabricate(user))
             post "/posts.json", params: {

GitHub
sha: b089ac15

third time’s a charm :relieved:

2 Likes