diff --git a/app/graphql/types/base_object.rb b/app/graphql/types/base_object.rb index d4dc9aaba..ba994e214 100644 --- a/app/graphql/types/base_object.rb +++ b/app/graphql/types/base_object.rb @@ -16,7 +16,7 @@ module Types end end - if administrateur + if administrateur && Flipper.enabled?(:administrateur_graphql, administrateur.user) context[:authorized][demarche.id] = true true end diff --git a/config/initializers/flipper.rb b/config/initializers/flipper.rb index dee6e022e..53d6f2820 100644 --- a/config/initializers/flipper.rb +++ b/config/initializers/flipper.rb @@ -26,6 +26,7 @@ end # A list of features to be deployed on first push features = [ :administrateur_champ_integer_number, + :administrateur_graphql, :administrateur_web_hook, :insee_api_v3, :instructeur_bypass_email_login_token, diff --git a/config/routes.rb b/config/routes.rb index 3a4beb78b..595299fcd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -219,7 +219,7 @@ Rails.application.routes.draw do # API # - authenticated :user, lambda { |user| user.administrateur_id } do + authenticated :user, lambda { |user| user.administrateur_id && Flipper.enabled?(:administrateur_graphql, user) } do mount GraphiQL::Rails::Engine, at: "/graphql", graphql_path: "/api/v2/graphql", via: :get end