This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
2012-10-09 06:47:16 +00:00
|
|
|
module Admin::ModuleAppsHelper
|
2012-01-17 08:20:03 +00:00
|
|
|
|
|
|
|
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)
|
2012-04-27 10:38:21 +00:00
|
|
|
showing_name = manager_obj.rule_creator==current_user ? t('me') : manager_obj.rule_creator.name
|
|
|
|
t("admin.user_role.auth.auth_by",:user_display_name => showing_name)
|
2012-01-17 08:20:03 +00:00
|
|
|
end
|
|
|
|
end
|