Fix incorrect value for feature_approval.current_user for local users (#38751)
This commit is contained in:
1 parent
c0b1fbe0a9
commit
ccf5c09ad3
3 files changed
+23
-8
No files matched your search
@@ -473,7 +473,7 @@ class Account < ApplicationRecord
|
||||
end
|
||||
|
||||
def featureable_by?(other_account)
|
||||
return discoverable? && (!locked? || followed_by?(other_account)) if local?
|
||||
return discoverable? && (!locked? || followed_by?(other_account) || other_account.id == id) if local?
|
||||
|
||||
feature_policy_for_account(other_account).in?(%i(automatic manual))
|
||||
end
|
||||
|
||||
@@ -18,7 +18,8 @@ module Account::InteractionPolicyConcern
|
||||
# Returns `:automatic`, `:manual`, `:unknown`, ':missing` or `:denied`
|
||||
def feature_policy_for_account(other_account)
|
||||
return :denied if other_account.nil? || (local? && !discoverable?)
|
||||
return :automatic if local?
|
||||
return locked? && !followed_by?(other_account) && self != other_account ? :denied : :automatic if local?
|
||||
|
||||
# Post author is always allowed to feature themselves
|
||||
return :automatic if self == other_account
|
||||
return :missing if feature_approval_policy.zero?
|
||||
|
||||
Reference in new issue
Block a user