diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb index 05b36ba3..dd75c675 100644 --- a/app/controllers/categories_controller.rb +++ b/app/controllers/categories_controller.rb @@ -32,6 +32,10 @@ class CategoriesController < ApplicationController private def render_react - render "/common/index", :layout => false + if LocalSetting.first.try(:exam) && !current_user.admin? + render_403 + else + render "/common/index", :layout => false + end end end diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index afb5b7dd..c1dae86e 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -28,7 +28,11 @@ class ForumsController < ApplicationController private def render_react - render "/common/index", :layout => false + if LocalSetting.first.try(:exam) && !current_user.admin? + render_403 + else + render "/common/index", :layout => false + end end end