translation_policy.rb 323 B

123456789101112
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class KnowledgeBase::Answer::TranslationPolicy < ApplicationPolicy
  3. delegate :show?, to: :parent_answer_policy
  4. delegate :update?, to: :parent_answer_policy
  5. private
  6. def parent_answer_policy
  7. Pundit.policy user, record.answer
  8. end
  9. end