From e4cf9d3ba92384bb5842ff86e9f2d37b86f630ae Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Mon, 5 May 2014 12:50:33 +0800 Subject: [PATCH] Added authorization to AdBanner --- app/controllers/admin/ad_banners_controller.rb | 8 +++++++- app/controllers/admin/ad_images_controller.rb | 2 +- lib/ad_banner/engine.rb | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/ad_banners_controller.rb b/app/controllers/admin/ad_banners_controller.rb index 17a626a..eca6896 100644 --- a/app/controllers/admin/ad_banners_controller.rb +++ b/app/controllers/admin/ad_banners_controller.rb @@ -1,4 +1,10 @@ -class Admin::AdBannersController < ApplicationController +class Admin::AdBannersController < OrbitAdminController + + def initialize + super + @app_title = "ad_banner" + end + def index @ad_banners = Banner.all end diff --git a/app/controllers/admin/ad_images_controller.rb b/app/controllers/admin/ad_images_controller.rb index 2a1107a..cf0b9c1 100644 --- a/app/controllers/admin/ad_images_controller.rb +++ b/app/controllers/admin/ad_images_controller.rb @@ -1,4 +1,4 @@ -class Admin::AdImagesController < ApplicationController +class Admin::AdImagesController < Admin::AdBannersController def index @ad_images = AdImage.all end diff --git a/lib/ad_banner/engine.rb b/lib/ad_banner/engine.rb index c558363..abb4116 100644 --- a/lib/ad_banner/engine.rb +++ b/lib/ad_banner/engine.rb @@ -8,9 +8,11 @@ module AdBanner taggable "Banner" categorizable + authorizable side_bar do head_label_i18n 'ad_banner.ad_banner', icon_class: "icons-landscape" + available_for [:admin,:manager,:sub_manager] active_for_controllers ({:private=>['ad_banner']}) head_link_path "admin_ad_banners_path"