aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
index 39b20b92cb4..5cd988308d3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
@@ -29,7 +29,7 @@ class RulesConfigurationController < ApplicationController
RULE_PRIORITIES = Sonar::RulePriority.as_options.reverse
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
- verify :method => :post, :only => ['activate_rule', 'update_param', 'bulk_edit', 'create', 'update', 'delete', 'change_parent'], :redirect_to => { :action => 'index' }
+ verify :method => :post, :only => ['activate_rule', 'update_param', 'bulk_edit', 'create', 'update', 'delete', 'change_parent', 'revert_rule'], :redirect_to => { :action => 'index' }
before_filter :admin_required, :except => [ 'index', 'export' ]
@@ -94,6 +94,19 @@ class RulesConfigurationController < ApplicationController
redirect_to :action => 'index', :id => params[:id]
end
+
+ #
+ #
+ # POST /rules_configuration/revert_rule?id=<profile id>&active_rule_id=<active rule id>
+ #
+ #
+ def revert_rule
+ id = params[:id].to_i
+ rule_id = params[:active_rule_id].to_i
+ java_facade.revertRule(id, rule_id)
+ redirect_to :action => 'index', :id => params[:id]
+ end
+
#
#