aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorXinhui Xu2017-09-12 15:52:49 +0200
committerGitHub2017-09-12 15:52:49 +0200
commit095dd5151d40d25c9abb015808834b32e575c750 (patch)
tree3aacd609bfbd277a5e33e8ee2208a3293f85a3ba /app/controllers/application_controller.rb
parente2270acdfcec57a8be2ada201a668d9d610953ab (diff)
parent4aa19d931f8585c061dd3da49e31b2ddbbb1bf6b (diff)
downloadchouette-core-095dd5151d40d25c9abb015808834b32e575c750.tar.bz2
Merge branch 'master' into compliance_control
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 47b54039c..853c2f715 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -33,8 +33,14 @@ class ApplicationController < ActionController::Base
end
helper_method :current_organisation
+ def current_offer_workbench
+ current_organisation.workbenches.find_by_name("Gestion de l'offre")
+ end
+ helper_method :current_offer_workbench
+
def current_functional_scope
- JSON.parse(current_organisation.sso_attributes["functional_scope"]) if current_organisation
+ functional_scope = current_organisation.sso_attributes.try(:[], "functional_scope") if current_organisation
+ JSON.parse(functional_scope) if functional_scope
end
helper_method :current_functional_scope