base_controller.rb 579 B

123456789101112131415161718192021222324252627
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class KnowledgeBase::BaseController < ApplicationController
  3. prepend_before_action :authenticate_and_authorize!
  4. def show
  5. model_show_render(klass, params_for_permission)
  6. end
  7. def create
  8. model_create_render(klass, params_for_permission)
  9. end
  10. def update
  11. model_update_render(klass, params_for_permission)
  12. end
  13. def destroy
  14. model_destroy_render(klass, params_for_permission)
  15. end
  16. private
  17. def params_for_permission
  18. params.permit klass.agent_allowed_params
  19. end
  20. end