fix for announcement is pro

This commit is contained in:
Harry Bomrah 2017-08-24 20:31:51 +08:00
parent 7daf685f2b
commit 0fd3501f4c
1 changed files with 5 additions and 1 deletions

View File

@ -290,9 +290,13 @@ class AnnouncementsController < ApplicationController
access_level = OrbitHelper.user_access_level?
if !announcement.approved && (access_level != "manager" && access_level != "admin")
if AnnouncementSetting.is_pro?
if !(access_level == "sub_manager" && AnnouncementSetting.first.approvers.include?(OrbitHelper.current_user.id.to_s))
return {}
end
elsif access_level != "sub_manager"
return {}
end
end
return {} if announcement.category.disable