trabajo-afectivo/app/controllers/knowledge_base/base_controller.rb

33 lines
671 B
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
2019-06-04 03:40:48 +00:00
class KnowledgeBase::BaseController < ApplicationController
prepend_before_action :authentication_check
before_action :authorize!
2019-06-04 03:40:48 +00:00
def show
model_show_render(klass, params_for_permission)
end
def create
model_create_render(klass, params_for_permission)
end
def update
model_update_render(klass, params_for_permission)
end
def destroy
model_destroy_render(klass, params_for_permission)
end
def klass
@klass ||= controller_path.classify.constantize
end
private
2019-06-04 03:40:48 +00:00
def params_for_permission
params.permit klass.agent_allowed_params
end
end