diff options
| author | Zog | 2018-03-26 11:12:25 +0200 | 
|---|---|---|
| committer | Zog | 2018-03-26 11:12:25 +0200 | 
| commit | deea16664b122b9db9c615980944a63f510c39f7 (patch) | |
| tree | 60adeaef608b58fdc40a12101f54d66fc1b83cda /app/controllers | |
| parent | 1a64e4cb265a320005247e54b880287d3308d28b (diff) | |
| download | chouette-core-deea16664b122b9db9c615980944a63f510c39f7.tar.bz2 | |
Refs #6218; Limit accessible exports for workgroups
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/development_toolbar_controller.rb | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/app/controllers/development_toolbar_controller.rb b/app/controllers/development_toolbar_controller.rb index 20349f7b8..be9a37eba 100644 --- a/app/controllers/development_toolbar_controller.rb +++ b/app/controllers/development_toolbar_controller.rb @@ -6,6 +6,13 @@ class DevelopmentToolbarController < ApplicationController      organisation.save      current_user.permissions = params[:permissions].keys.select{|k| params[:permissions][k] == "true"}      current_user.save +    if params[:export_types].present? +      params[:export_types].each do |workgroup_id, export_types| +        workgroup = Workgroup.find workgroup_id +        workgroup.export_types = export_types.keys.select{|k| export_types[k] == "true"} +        workgroup.save! +      end +    end      redirect_to request.referrer || "/"    end  end | 
