mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-03 13:33:32 -05:00
18 lines
286 B
Ruby
18 lines
286 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AccountWarningPolicy < ApplicationPolicy
|
|
def show?
|
|
target? || role.can?(:manage_appeals)
|
|
end
|
|
|
|
def appeal?
|
|
target? && record.appeal_eligible?
|
|
end
|
|
|
|
private
|
|
|
|
def target?
|
|
record.target_account_id == current_account&.id
|
|
end
|
|
end
|