From 4c217ec12f0813c5c3e753c8a51a9cce76637770 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Thu, 22 Aug 2013 15:18:54 +0800 Subject: [PATCH] Updated Authorizations for Adbanner, Calendar, Location --- app/controllers/admin/ad_banners_controller.rb | 9 +++------ vendor/built_in_modules/ad_banner/init.rb | 6 +----- .../calendar_new/back_end/events_controller.rb | 1 + vendor/built_in_modules/calendar_new/init.rb | 5 ----- .../gallery/back_end/albums_controller.rb | 18 +----------------- .../location/back_end/locations_controller.rb | 3 --- vendor/built_in_modules/location/init.rb | 1 + 7 files changed, 7 insertions(+), 36 deletions(-) diff --git a/app/controllers/admin/ad_banners_controller.rb b/app/controllers/admin/ad_banners_controller.rb index 37ac3fac..d05622b0 100644 --- a/app/controllers/admin/ad_banners_controller.rb +++ b/app/controllers/admin/ad_banners_controller.rb @@ -1,10 +1,7 @@ class Admin::AdBannersController < OrbitBackendController - - before_filter :force_order_for_visitor,:only=>[:index, :show] - before_filter :force_order_for_user,:except => [:index, :show] - before_filter :for_app_sub_manager,:except => [:index, :show] - before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview] - + open_for_visitor :only => [:index, :show] + open_for_manager :except => [:index,:show,:update,:realtime_preview] + open_for_sub_manager :except => [:index, :show] def rename @ad_banner = AdBanner.find(params[:id]) diff --git a/vendor/built_in_modules/ad_banner/init.rb b/vendor/built_in_modules/ad_banner/init.rb index 80e7d278..a0225730 100644 --- a/vendor/built_in_modules/ad_banner/init.rb +++ b/vendor/built_in_modules/ad_banner/init.rb @@ -11,6 +11,7 @@ module AdBanner update_info 'some update_info' taggable + authorizable # front_end do # app_page 'bulletins' @@ -65,11 +66,6 @@ module AdBanner :active_for_tag => 'Announcement', :available_for => [:manager] - context_link 'module_authorization', - :link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'AdBanner'}))", - :priority=>6, - :active_for_app_auth => 'ad_banners', - :available_for => [:admin] end end end diff --git a/vendor/built_in_modules/calendar_new/app/controllers/panel/calendar_new/back_end/events_controller.rb b/vendor/built_in_modules/calendar_new/app/controllers/panel/calendar_new/back_end/events_controller.rb index 62765da0..abb0441c 100644 --- a/vendor/built_in_modules/calendar_new/app/controllers/panel/calendar_new/back_end/events_controller.rb +++ b/vendor/built_in_modules/calendar_new/app/controllers/panel/calendar_new/back_end/events_controller.rb @@ -1,4 +1,5 @@ class Panel::CalendarNew::BackEnd::EventsController < OrbitBackendController + open_for_visitor :only => [:index, :show] # GET /events # GET /events.json diff --git a/vendor/built_in_modules/calendar_new/init.rb b/vendor/built_in_modules/calendar_new/init.rb index 17c1e32d..c1aee0c8 100644 --- a/vendor/built_in_modules/calendar_new/init.rb +++ b/vendor/built_in_modules/calendar_new/init.rb @@ -39,11 +39,6 @@ module CalendarNew :active_for_tag => 'CalendarNew', :available_for => [:manager] - context_link 'module_authorization', - :link_path=>"admin_authorizations_path(get_module_app.key)", - :priority=>6, - :available_for => [:manager] - context_link 'calendar.color', :link_path=>"panel_calendar_new_back_end_event_categories_path" , :priority=>3, diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb index 5440d972..e9efa9ab 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb @@ -1,19 +1,8 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController - include AdminHelper - - # before_filter :force_order_for_user, :except => [:index,:get_album_json,:get_imgs_json] - - before_filter :force_order_for_visitor,:only=>[:index,:show,:get_album_json,:get_imgs_json,:get_albums,:imgs] - before_filter :force_order_for_user,:except => [:index,:show,:get_album_json,:get_imgs_json,:get_albums,:imgs] - before_filter :for_app_sub_manager,:except => [:index,:show,:get_album_json,:get_imgs_json,:get_albums,:imgs] + # before_filter lambda def index - if is_manager? || is_admin? || is_sub_manager? - @authenticated = true #turn this value to false for view only - else - @authenticated = false - end @categories = get_categories_for_index @albums = GalleryAlbum.all @tags = get_tags @@ -24,11 +13,6 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController end def show - if is_manager? || is_admin? || is_sub_manager? - @authenticated = true #turn this value to false for view only - else - @authenticated = false - end @album = GalleryAlbum.find(params[:id]) @images = @album.gallery_images end diff --git a/vendor/built_in_modules/location/app/controllers/panel/location/back_end/locations_controller.rb b/vendor/built_in_modules/location/app/controllers/panel/location/back_end/locations_controller.rb index 3f3119ea..c1a2bab2 100644 --- a/vendor/built_in_modules/location/app/controllers/panel/location/back_end/locations_controller.rb +++ b/vendor/built_in_modules/location/app/controllers/panel/location/back_end/locations_controller.rb @@ -1,9 +1,6 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController include AdminHelper - before_filter :force_order_for_visitor,:only => [:index, :new, :edit, :create, :update, :delete] - before_filter :force_order_for_user,:except => [:get_locations,:index,:get_categories] - def index @location_infos = LocationInfo.all @categories = get_categories_for_index diff --git a/vendor/built_in_modules/location/init.rb b/vendor/built_in_modules/location/init.rb index 843ef56a..a0767bc7 100644 --- a/vendor/built_in_modules/location/init.rb +++ b/vendor/built_in_modules/location/init.rb @@ -32,6 +32,7 @@ module Location # end categorizable + authorizable side_bar do head_label_i18n 'location.location',:icon_class=>"icons-location"