Commit d851006290b5a426f3ae167336073394aed8d9d8

Authored by Diego Camarinha
Committed by Rafael Manzo
1 parent b0caefdf

Fixed permission for metric_configuration

Signed off by: Renan Fichberg <rfichberg@gmail.com>
app/controllers/concerns/ownership_authentication.rb
... ... @@ -26,7 +26,14 @@ module OwnershipAuthentication
26 26 end
27 27  
28 28 def mezuro_configuration_owner?
29   - check_mezuro_configuration_ownership(params[:id])
  29 + if self.kind_of?(MezuroConfigurationsController)
  30 + id = params[:id]
  31 + elsif self.kind_of?(MetricConfigurationsController)
  32 + id = params[:mezuro_configuration_id]
  33 + else
  34 + raise "Not supported"
  35 + end
  36 + check_mezuro_configuration_ownership(id)
30 37 end
31 38  
32 39 private
... ...