Proof authed_users for case when no category
This commit is contained in:
parent
8ad7f70822
commit
d9c12ea5a4
|
@ -8,7 +8,7 @@ defaults: &defaults
|
|||
|
||||
development:
|
||||
<<: *defaults
|
||||
database: prototype_r4_development
|
||||
database: prototype_r4_ldap0229
|
||||
|
||||
test:
|
||||
<<: *defaults
|
||||
|
@ -22,4 +22,4 @@ production:
|
|||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||
<<: *defaults
|
||||
database: prototype_r4_development
|
||||
database: prototype_r4_ldap0229
|
||||
|
|
|
@ -45,7 +45,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
|
||||
if(!is_admin? || !is_manager?)
|
||||
@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)
|
||||
bulletin.is_pending == true && ((!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) || bulletin.create_user_id!=current_user.id)
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ module Panel::Announcement::BackEnd::BulletinsHelper
|
|||
|
||||
def show_approval_link(bulletin)
|
||||
by_bulletin = (!bulletin.is_expired? and !bulletin.is_checked?)
|
||||
by_user = (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? or is_admin?)
|
||||
by_user = ((bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) or is_manager? or is_admin?)
|
||||
by_bulletin and by_user
|
||||
end
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
|
|||
@link_url = panel_news_back_end_news_bulletins_path
|
||||
|
||||
@news_bulletins.delete_if{ |news_bulletin|
|
||||
news_bulletin.is_pending == true && (!news_bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || news_bulletin.create_user_id!=current_user.id)
|
||||
news_bulletin.is_pending == true && ((!news_bulletin.bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) || news_bulletin.create_user_id!=current_user.id)
|
||||
}
|
||||
|
||||
@news_bulletin_file = NewsBulletinFile.new
|
||||
|
|
|
@ -2,7 +2,7 @@ module Panel::News::BackEnd::NewsBulletinsHelper
|
|||
|
||||
def news_show_approval_link(news_bulletin)
|
||||
by_news_bulletin = (!news_bulletin.is_expired? and !news_bulletin.is_checked?)
|
||||
by_user = news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?
|
||||
by_user = (news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) or is_manager?
|
||||
by_news_bulletin and by_user
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue