summaryrefslogtreecommitdiff
path: root/app/controllers/projects/feature_flags_controller.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
committerRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
commit6438df3a1e0fb944485cebf07976160184697d72 (patch)
tree00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/controllers/projects/feature_flags_controller.rb
parent42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff)
downloadgitlab-ce-13.8.0-rc42.tar.gz
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/controllers/projects/feature_flags_controller.rb')
-rw-r--r--app/controllers/projects/feature_flags_controller.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/controllers/projects/feature_flags_controller.rb b/app/controllers/projects/feature_flags_controller.rb
index da9dcd1c09c..6b6606c4f41 100644
--- a/app/controllers/projects/feature_flags_controller.rb
+++ b/app/controllers/projects/feature_flags_controller.rb
@@ -10,12 +10,10 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
before_action :feature_flag, only: [:edit, :update, :destroy]
- before_action :ensure_legacy_flags_writable!, only: [:update]
+ before_action :ensure_flag_writable!, only: [:update]
before_action do
push_frontend_feature_flag(:feature_flag_permissions)
- push_frontend_feature_flag(:feature_flags_legacy_read_only, project, default_enabled: true)
- push_frontend_feature_flag(:feature_flags_legacy_read_only_override, project)
end
feature_category :feature_flags
@@ -103,10 +101,8 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
@feature_flag ||= @noteable = project.operations_feature_flags.find_by_iid!(params[:iid])
end
- def ensure_legacy_flags_writable!
- if ::Feature.enabled?(:feature_flags_legacy_read_only, project, default_enabled: true) &&
- ::Feature.disabled?(:feature_flags_legacy_read_only_override, project) &&
- feature_flag.legacy_flag?
+ def ensure_flag_writable!
+ if feature_flag.legacy_flag?
render_error_json(['Legacy feature flags are read-only'])
end
end