New authorization

This commit is contained in:
chris committed 2013-08-21 13:42:29 +08:00
1 parent d24bd176cc
commit c474fa063f
25 files changed
+440 -172

No files matched your search

+2 -2
View File
@@ -9,11 +9,11 @@ module OrbitCategory
end
end
def get_categories_for_form(func_authed_for_sub_manager = "category_#{@module_app.key}")
def get_categories_for_form
categories = if is_manager? || is_admin?
@module_app.categories.enabled
elsif is_sub_manager?
@module_app.categories.enabled.authed_for_user(current_user, func_authed_for_sub_manager)
@module_app.categories.enabled.entries.delete_if{|category| !category.user_can_sub_manage?(current_user)}
end
if categories.empty?
flash[:alert] = t(:no_category)