diff options
Diffstat (limited to 'app/controllers/graphql_controller.rb')
-rw-r--r-- | app/controllers/graphql_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/graphql_controller.rb b/app/controllers/graphql_controller.rb index 515fbd7b482..0722a712b5c 100644 --- a/app/controllers/graphql_controller.rb +++ b/app/controllers/graphql_controller.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class GraphqlController < ApplicationController + extend ::Gitlab::Utils::Override + # Unauthenticated users have access to the API for public data skip_before_action :authenticate_user! @@ -35,6 +37,7 @@ class GraphqlController < ApplicationController # callback execution order here around_action :sessionless_bypass_admin_mode!, if: :sessionless_user? + # The default feature category is overridden to read from request feature_category :not_owned def execute @@ -64,6 +67,11 @@ class GraphqlController < ApplicationController render_error(exception.message, status: :unprocessable_entity) end + override :feature_category + def feature_category + ::Gitlab::FeatureCategories.default.from_request(request) || super + end + private def disallow_mutations_for_get |