Files
danbooru/app/policies/post_version_policy.rb
evazion a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00

16 lines
342 B
Ruby

# frozen_string_literal: true
class PostVersionPolicy < ApplicationPolicy
def undo?
unbanned? && record.version > 1 && record.post.present? && policy(record.post).visible?
end
def can_mass_undo?
user.is_builder?
end
def api_attributes
super + [:obsolete_added_tags, :obsolete_removed_tags, :unchanged_tags]
end
end