Fix for manager and admin can see all post in announcement. Haven't applied to news

This commit is contained in:
Matthew K. Fu JuYuan 2012-05-11 17:07:21 +08:00
parent 82d1d3fed8
commit e696516aae
1 changed files with 6 additions and 4 deletions

View File

@ -43,10 +43,12 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@bulletin_file = BulletinFile.new @bulletin_file = BulletinFile.new
@file_url = panel_announcement_back_end_bulletins_path @file_url = panel_announcement_back_end_bulletins_path
@bulletins.delete_if{ |bulletin| if(!is_admin? || !is_manager?)
bulletin.is_pending == true && (!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || bulletin.create_user_id!=current_user.id) @bulletins.delete_if{ |bulletin|
} bulletin.is_pending == true && (!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || bulletin.create_user_id!=current_user.id)
}
end
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js { } format.js { }