Fix's Matt code for not showing bulletins in index

This commit is contained in:
Christophe Vilayphiou 2012-05-21 18:10:03 +08:00
parent 815e6a8361
commit c4d7079059
1 changed files with 9 additions and 1 deletions

View File

@ -168,7 +168,15 @@ class OrbitBackendController< ApplicationController
end end
if(!is_admin? || !is_manager?) if(!is_admin? || !is_manager?)
objects.delete_if{ |object| objects.delete_if{ |object|
(object.is_pending == true) && ((!object.send("#{object.class.to_s.underscore}_category").authed_users('fact_check').include?(current_user) rescue nil) || object.create_user_id!=current_user.id) if object.is_pending == true
if check_permission(:manager)
object.create_user_id != current_user.id
else
!object.send("#{object.class.to_s.underscore}_category").authed_users('fact_check').include?(current_user) rescue false
end
else
false
end
} }
end end
objects objects