Updated Authorizations for Adbanner, Calendar, Location

This commit is contained in:
saurabhbhatia 2013-08-22 15:18:54 +08:00
parent 452da1b8ec
commit 4c217ec12f
7 changed files with 7 additions and 36 deletions

View File

@ -1,10 +1,7 @@
class Admin::AdBannersController < OrbitBackendController class Admin::AdBannersController < OrbitBackendController
open_for_visitor :only => [:index, :show]
before_filter :force_order_for_visitor,:only=>[:index, :show] open_for_manager :except => [:index,:show,:update,:realtime_preview]
before_filter :force_order_for_user,:except => [:index, :show] open_for_sub_manager :except => [:index, :show]
before_filter :for_app_sub_manager,:except => [:index, :show]
before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview]
def rename def rename
@ad_banner = AdBanner.find(params[:id]) @ad_banner = AdBanner.find(params[:id])

View File

@ -11,6 +11,7 @@ module AdBanner
update_info 'some update_info' update_info 'some update_info'
taggable taggable
authorizable
# front_end do # front_end do
# app_page 'bulletins' # app_page 'bulletins'
@ -65,11 +66,6 @@ module AdBanner
:active_for_tag => 'Announcement', :active_for_tag => 'Announcement',
:available_for => [:manager] :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 end
end end

View File

@ -1,4 +1,5 @@
class Panel::CalendarNew::BackEnd::EventsController < OrbitBackendController class Panel::CalendarNew::BackEnd::EventsController < OrbitBackendController
open_for_visitor :only => [:index, :show]
# GET /events # GET /events
# GET /events.json # GET /events.json

View File

@ -39,11 +39,6 @@ module CalendarNew
:active_for_tag => 'CalendarNew', :active_for_tag => 'CalendarNew',
:available_for => [:manager] :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', context_link 'calendar.color',
:link_path=>"panel_calendar_new_back_end_event_categories_path" , :link_path=>"panel_calendar_new_back_end_event_categories_path" ,
:priority=>3, :priority=>3,

View File

@ -1,19 +1,8 @@
class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController 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 # before_filter lambda
def index 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 @categories = get_categories_for_index
@albums = GalleryAlbum.all @albums = GalleryAlbum.all
@tags = get_tags @tags = get_tags
@ -24,11 +13,6 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
end end
def show 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]) @album = GalleryAlbum.find(params[:id])
@images = @album.gallery_images @images = @album.gallery_images
end end

View File

@ -1,9 +1,6 @@
class Panel::Location::BackEnd::LocationsController < OrbitBackendController class Panel::Location::BackEnd::LocationsController < OrbitBackendController
include AdminHelper 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 def index
@location_infos = LocationInfo.all @location_infos = LocationInfo.all
@categories = get_categories_for_index @categories = get_categories_for_index

View File

@ -32,6 +32,7 @@ module Location
# end # end
categorizable categorizable
authorizable
side_bar do side_bar do
head_label_i18n 'location.location',:icon_class=>"icons-location" head_label_i18n 'location.location',:icon_class=>"icons-location"