diff options
Diffstat (limited to 'lib/stif')
| -rw-r--r-- | lib/stif/dashboard.rb | 15 | ||||
| -rw-r--r-- | lib/stif/permission_translator.rb | 12 |
2 files changed, 24 insertions, 3 deletions
diff --git a/lib/stif/dashboard.rb b/lib/stif/dashboard.rb new file mode 100644 index 000000000..fafddec62 --- /dev/null +++ b/lib/stif/dashboard.rb @@ -0,0 +1,15 @@ +module Stif + class Dashboard < ::Dashboard + def workbench + @workbench ||= current_organisation.workbenches.find_by(name: "Gestion de l'offre") + end + + def referentials + @referentials ||= @workbench.all_referentials + end + + def calendars + @calendars ||= Calendar.where('organisation_id = ? OR shared = ?', current_organisation.id, true) + end + end +end diff --git a/lib/stif/permission_translator.rb b/lib/stif/permission_translator.rb index 2bc565968..121e89694 100644 --- a/lib/stif/permission_translator.rb +++ b/lib/stif/permission_translator.rb @@ -17,19 +17,25 @@ module Stif def all_resources %w[ access_points - connection_links calendars + connection_links + calendars footnotes + imports journey_patterns - referentials routes routing_constraint_zones + referentials + routes + routing_constraint_zones time_tables vehicle_journeys api_keys compliance_controls + compliance_controls_sets + compliance_controls_blocks + compliance_check_sets ] end def destructive_permissions_for(models) - @__destructive_permissions_for__ ||= models.product( %w{create destroy update} ).map{ |model_action| model_action.join('.') } end |
