From 3da162bf85b249bb3a05f84b18342b3061da9c8a Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Fri, 15 Jan 2021 15:12:29 -0500 Subject: [PATCH] Updated StatusPolicy to allow status viewing anytime status is owned by viewer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated: - StatusPolicy to allow status viewing anytime status is owned by viewer --- app/policies/status_policy.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/policies/status_policy.rb b/app/policies/status_policy.rb index a8b05f18..afc052c9 100644 --- a/app/policies/status_policy.rb +++ b/app/policies/status_policy.rb @@ -65,18 +65,21 @@ class StatusPolicy < ApplicationPolicy def blocking_author? return false if current_account.nil? + return false if owned? @preloaded_relations[:blocking] ? @preloaded_relations[:blocking][author.id] : current_account.blocking?(author) end def author_blocking? return false if current_account.nil? - + return false if owned? + @preloaded_relations[:blocked_by] ? @preloaded_relations[:blocked_by][author.id] : author.blocking?(current_account) end def following_author? return false if current_account.nil? + return true if owned? @preloaded_relations[:following] ? @preloaded_relations[:following][author.id] : current_account.following?(author) end