First version of app and object auth for web_resource module. Basic fund is ok. backend need to be secued

This commit is contained in:
Matthew K. Fu JuYuan committed 2012-05-15 18:55:16 +08:00
1 parent b23b5e8ec5
commit 3f744dab05
14 files changed
+53 -22

No files matched your search

+3 -5
View File
@@ -16,8 +16,8 @@ module Admin::AdBannerHelper
end
def show_ad_banner_permission_link(ad_banner)
type = 'edit'
oa = ad_banner.get_object_auth_by_title(type)
type = 'edit'
oa = ad_banner.get_object_auth_by_title(type)
if oa.nil?
ad_banner.object_auths.new(title: type ).save
oa = ad_banner.get_object_auth_by_title(type)
@@ -26,8 +26,6 @@ module Admin::AdBannerHelper
link_to t('admin.ad.cate_auth'),admin_object_auth_ob_auth_path(oa),:class => "btn btn-warning"
end
def at_least_module_manager
is_manager? || is_admin?
end
end
+11
View File
@@ -0,0 +1,11 @@
module Admin::WebLinkHelper
def show_web_link_permission_link(web_link)
type = 'edit'
oa = web_link.get_object_auth_by_title(type)
if oa.nil?
web_link.object_auths.new(title: type ).save
oa = web_link.get_object_auth_by_title(type)
end
link_to t('admin.web_link.cate_auth'),admin_object_auth_ob_auth_path(oa)
end
end
+4
View File
@@ -173,4 +173,8 @@ module ApplicationHelper
locale.to_sym == I18n.locale ? 'active in': ''
end
def at_least_module_manager
is_manager? || is_admin?
end
end