diff --git a/app/controllers/contest_descriptions_controller.rb b/app/controllers/contest_descriptions_controller.rb index beb67648..2296d0ee 100644 --- a/app/controllers/contest_descriptions_controller.rb +++ b/app/controllers/contest_descriptions_controller.rb @@ -97,11 +97,22 @@ def handle_save(success, action) end def set_container - @container = policy_scope(Container).find(params[:container_id]) + # For eligibility_rules action, allow all users to access any container + if action_name == 'eligibility_rules' + @container = Container.find(params[:container_id]) + else + @container = policy_scope(Container).find(params[:container_id]) + end end def set_contest_description - @contest_description = policy_scope(ContestDescription).find(params[:id]) + # For eligibility_rules action, allow all users to access any contest description + if action_name == 'eligibility_rules' + @contest_description = ContestDescription.find(params[:id]) + else + # For other actions, use policy scope to restrict access + @contest_description = policy_scope(ContestDescription).find(params[:id]) + end end def contest_description_params