First complete with manager and submanager

This commit is contained in:
Matthew Fu authored and Christophe Vilayphiou committed 2012-01-24 12:28:32 +08:00
1 parent 4df8ab6cc3
commit 4ed8a2164c
7 files changed
+52 -15

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
module Admin::ModuleAppHelper
def if_permit_to_delete(item)
case item.downcase
when :manager
current_user.admin?
when :sub_manager
@module_app.managing_users.include?(current_user) || current_user.admin?
end
end
def if_permit_to_assign(item)
if_permit_to_delete(item)
end
def get_auth_by(manager_obj)
"-AuthBy: " +( manager_obj.rule_creator==current_user ? t('me') : manager_obj.rule_creator.name)
end
end