From 399dfad392b13edc77b05a7c3e37c572c2ea4740 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 22 Aug 2013 17:56:13 +0800 Subject: [PATCH] faq authorization completed. --- .../panel/faq/back_end/qas_controller.rb | 30 ++++++++----------- .../panel/faq/back_end/qas/_form.html.erb | 1 + vendor/built_in_modules/faq/init.rb | 2 +- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/vendor/built_in_modules/faq/app/controllers/panel/faq/back_end/qas_controller.rb b/vendor/built_in_modules/faq/app/controllers/panel/faq/back_end/qas_controller.rb index 2ced73bf..2883fc06 100644 --- a/vendor/built_in_modules/faq/app/controllers/panel/faq/back_end/qas_controller.rb +++ b/vendor/built_in_modules/faq/app/controllers/panel/faq/back_end/qas_controller.rb @@ -1,29 +1,25 @@ class Panel::Faq::BackEnd::QasController < OrbitBackendController - # before_filter :for_app_manager,:except => [:index,:show] - include AdminHelper - # include OrbitControllerLib::DivisionForDisable - - before_filter :force_order_for_visitor,:only=>[:index] - before_filter :force_order_for_user,:except => [:index] - - before_filter :for_app_sub_manager,:except => [:index] + + open_for_sub_manager :except => [:index] + before_filter :only => [ :new, :create, :edit, :update ] do |controller| @categories = get_categories_for_form end def index - @tags = get_tags - @categories = get_categories_for_index - @statuses = get_statuses - category_ids = @categories.collect{|t| t.id} + @tags = get_tags + @statuses = get_statuses + @categories = get_categories_for_index + category_ids = @categories.collect{|t| t.id} @qas = get_sorted_and_filtered("qa", :category_id.in => category_ids) - respond_to do |format| - format.html # index.html.erb - format.xml { render :xml => @qas } - format.js - end + + # respond_to do |format| + # format.html # index.html.erb + # format.xml { render :xml => @qas } + # format.js + # end end # GET /qas/1 diff --git a/vendor/built_in_modules/faq/app/views/panel/faq/back_end/qas/_form.html.erb b/vendor/built_in_modules/faq/app/views/panel/faq/back_end/qas/_form.html.erb index ea5a7c26..014e826e 100644 --- a/vendor/built_in_modules/faq/app/views/panel/faq/back_end/qas/_form.html.erb +++ b/vendor/built_in_modules/faq/app/views/panel/faq/back_end/qas/_form.html.erb @@ -77,6 +77,7 @@ <% end %> diff --git a/vendor/built_in_modules/faq/init.rb b/vendor/built_in_modules/faq/init.rb index 1ace1553..85d11913 100644 --- a/vendor/built_in_modules/faq/init.rb +++ b/vendor/built_in_modules/faq/init.rb @@ -21,6 +21,7 @@ module Faq taggable categorizable + authorizable widgets do default_widget do @@ -40,7 +41,6 @@ module Faq # end end - taggable side_bar do head_label_i18n 'faq.faq',:icon_class=>"icons-help"