2
0

Change media attachments in moderated posts to not be accessible (#34872)

This commit is contained in:
Eugen Rochko
2025-06-12 10:53:02 +02:00
committed by GitHub
parent d1fb957361
commit 24d943fee0
13 changed files with 140 additions and 111 deletions

View File

@@ -0,0 +1,13 @@
# frozen_string_literal: true
class MediaAttachmentPolicy < ApplicationPolicy
def download?
(record.discarded? && role.can?(:manage_reports)) || show_status?
end
private
def show_status?
record.status && StatusPolicy.new(current_account, record.status).show?
end
end