Change authorization to accept other than category

This commit is contained in:
chris committed 2013-07-25 17:36:55 +08:00
1 parent 0c208d0020
commit da1d70efcb
7 files changed
+60 -52

No files matched your search

+7 -1
View File
@@ -53,7 +53,7 @@ namespace :new_ui do
when 'fact_check'
new_object_auth = new_category.get_object_auth_by_title("approval_#{module_app.key}")
else
new_object_auth = new_category.get_object_auth_by_title("submit_#{module_app.key}")
new_object_auth = new_category.get_object_auth_by_title("category_#{module_app.key}")
end
object_auth.auth_users.each do |user|
new_object_auth.add_user_to_privilege_list(user)
@@ -85,4 +85,10 @@ namespace :new_ui do
end
end
task :change_auth_naming => :environment do
ObjectAuth.where(title: /submit_/).each do |auth|
auth.update_attribute(:title, auth.title.gsub('submit_', 'category_'))
end
end
end