mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 07:49:29 +00:00
Merge commit '591df1f205c654381203b56d46498efc62370776' into glitch-soc/merge-upstream
This commit is contained in:
7
app/policies/quote_policy.rb
Normal file
7
app/policies/quote_policy.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class QuotePolicy < ApplicationPolicy
|
||||
def revoke?
|
||||
record.quoted_account_id.present? && record.quoted_account_id == current_account&.id
|
||||
end
|
||||
end
|
||||
@@ -22,7 +22,7 @@ class StatusPolicy < ApplicationPolicy
|
||||
|
||||
# This is about requesting a quote post, not validating it
|
||||
def quote?
|
||||
record.quote_policy_for_account(current_account, preloaded_relations: @preloaded_relations) != :denied
|
||||
show? && record.quote_policy_for_account(current_account, preloaded_relations: @preloaded_relations) != :denied
|
||||
end
|
||||
|
||||
def reblog?
|
||||
@@ -37,6 +37,10 @@ class StatusPolicy < ApplicationPolicy
|
||||
owned?
|
||||
end
|
||||
|
||||
def list_quotes?
|
||||
owned?
|
||||
end
|
||||
|
||||
alias unreblog? destroy?
|
||||
|
||||
def update?
|
||||
|
||||
Reference in New Issue
Block a user