From d851006290b5a426f3ae167336073394aed8d9d8 Mon Sep 17 00:00:00 2001 From: Diego Araújo Date: Wed, 5 Feb 2014 09:38:11 -0200 Subject: [PATCH] Fixed permission for metric_configuration --- app/controllers/concerns/ownership_authentication.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/ownership_authentication.rb b/app/controllers/concerns/ownership_authentication.rb index 718790b..d93779f 100644 --- a/app/controllers/concerns/ownership_authentication.rb +++ b/app/controllers/concerns/ownership_authentication.rb @@ -26,7 +26,14 @@ module OwnershipAuthentication end def mezuro_configuration_owner? - check_mezuro_configuration_ownership(params[:id]) + if self.kind_of?(MezuroConfigurationsController) + id = params[:id] + elsif self.kind_of?(MetricConfigurationsController) + id = params[:mezuro_configuration_id] + else + raise "Not supported" + end + check_mezuro_configuration_ownership(id) end private -- libgit2 0.21.2