base_controller.rb 600 B

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