mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-13 07:48:15 +00:00
14 lines
288 B
Ruby
14 lines
288 B
Ruby
# 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
|