Fix sidebar and hide some links by roles

This commit is contained in:
Matthew K. Fu JuYuan committed 2012-05-16 12:10:16 +08:00
1 parent 3f744dab05
commit 88a26cc6a1
4 files changed
+21 -11

No files matched your search

@@ -1,5 +1,6 @@
class Panel::WebResource::BackEnd::WebLinkCategorysController < OrbitBackendController
before_filter :for_app_manager,:except => [:index]
def index
@web_link_categorys = WebLinkCategory.all
@web_link_category = WebLinkCategory.new(:display => 'List')
@@ -1,7 +1,7 @@
class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
before_filter :authenticate_user!
# before_filter :for_app_manager,:except => [:index,:show]
# before_filter :for_app_sub_manager
before_filter :for_app_sub_manager,:except => [:index]
def index
@@ -134,6 +134,13 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
def get_categorys(id = nil)
@web_link_categorys = (id ? WebLinkCategory.find(id).to_a : WebLinkCategory.excludes('disabled' => true))
@web_link_categorys = []
if(is_manager? || is_admin?)
@web_link_categorys = (id ? WebLinkCategory.find(id).to_a : WebLinkCategory.excludes('disabled' => true))
elsif is_sub_manager?
@web_link_categorys = WebLinkCategory.authed_for_user(current_user,'edit')
end
end
def get_tags