Commit f5acdbd0148b0222a6545c5f47ba99b7c4f0feb3

Authored by Rodrigo Souto
1 parent 12761a56

Blocking access from Bsc to destroy produts

(ActionItem2097)
Showing 1 changed file with 11 additions and 0 deletions   Show diff stats
plugins/bsc/lib/bsc_plugin.rb
@@ -84,6 +84,17 @@ class BscPlugin < Noosfero::Plugin @@ -84,6 +84,17 @@ class BscPlugin < Noosfero::Plugin
84 end 84 end
85 end 85 end
86 86
  87 + def manage_products_controller_filters
  88 + if bsc?(profile)
  89 + [{ :type => 'before_filter',
  90 + :method_name => 'manage_products_bsc_destroy_access',
  91 + :options => {:only => :destroy},
  92 + :block => lambda { render_access_denied } }]
  93 + else
  94 + []
  95 + end
  96 + end
  97 +
87 def asset_product_properties(product) 98 def asset_product_properties(product)
88 properties = [] 99 properties = []
89 properties << { :name => _('Bsc'), :content => lambda { link_to(product.bsc.name, product.bsc.url) } } if product.bsc 100 properties << { :name => _('Bsc'), :content => lambda { link_to(product.bsc.name, product.bsc.url) } } if product.bsc