Commit d7395695 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '258980-feature-flag-rollout-of-admin-approval-for-new-user-signups' into 'master'

Remove admin_approval_for_new_user_signups feature flag

See merge request gitlab-org/gitlab!46051
parents 363d55d5 fccf699e
......@@ -6,7 +6,6 @@ class Admin::UsersController < Admin::ApplicationController
before_action :user, except: [:index, :new, :create]
before_action :check_impersonation_availability, only: :impersonate
before_action :ensure_destroy_prerequisites_met, only: [:destroy]
before_action :check_admin_approval_feature_available!, only: [:approve]
feature_category :users
......@@ -298,10 +297,6 @@ class Admin::UsersController < Admin::ApplicationController
def log_impersonation_event
Gitlab::AppLogger.info(_("User %{current_user_username} has started impersonating %{username}") % { current_user_username: current_user.username, username: user.username })
end
def check_admin_approval_feature_available!
access_denied! unless Feature.enabled?(:admin_approval_for_new_user_signups, default_enabled: true)
end
end
Admin::UsersController.prepend_if_ee('EE::Admin::UsersController')
......@@ -218,7 +218,6 @@ class RegistrationsController < Devise::RegistrationsController
end
def set_user_state
return unless Feature.enabled?(:admin_approval_for_new_user_signups, default_enabled: true)
return unless Gitlab::CurrentSettings.require_admin_approval_after_user_signup
resource.state = BLOCKED_PENDING_APPROVAL_STATE
......
......@@ -9,7 +9,6 @@
Sign-up enabled
.form-text.text-muted
= _("When enabled, any user visiting %{host} will be able to create an account.") % { host: "#{new_user_session_url(host: Gitlab.config.gitlab.host)}" }
- if Feature.enabled?(:admin_approval_for_new_user_signups, default_enabled: true)
.form-group
.form-check
= f.check_box :require_admin_approval_after_user_signup, class: 'form-check-input'
......
......@@ -30,7 +30,6 @@
= link_to admin_users_path(filter: "blocked") do
= s_('AdminUsers|Blocked')
%small.badge.badge-pill= limited_counter_with_delimiter(User.blocked)
- if Feature.enabled?(:admin_approval_for_new_user_signups, default_enabled: true)
= nav_link(html_options: { class: "#{active_when(params[:filter] == 'blocked_pending_approval')} filter-blocked-pending-approval" }) do
= link_to admin_users_path(filter: "blocked_pending_approval") do
= s_('AdminUsers|Pending approval')
......
---
title: Remove admin_approval_for_new_user_signups feature flag
merge_request: 46051
author:
type: changed
......@@ -107,23 +107,6 @@ RSpec.describe Admin::UsersController do
subject { put :approve, params: { id: user.username } }
context 'when feature is disabled' do
before do
stub_feature_flags(admin_approval_for_new_user_signups: false)
end
it 'responds with access denied' do
subject
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when feature is enabled' do
before do
stub_feature_flags(admin_approval_for_new_user_signups: true)
end
context 'when successful' do
it 'activates the user' do
subject
......@@ -152,7 +135,6 @@ RSpec.describe Admin::UsersController do
end
end
end
end
describe 'PUT #activate' do
shared_examples 'a request that activates the user' do
......
......@@ -46,11 +46,6 @@ RSpec.describe RegistrationsController do
subject { post(:create, params: user_params) }
context '`blocked_pending_approval` state' do
context 'when the feature is enabled' do
before do
stub_feature_flags(admin_approval_for_new_user_signups: true)
end
context 'when the `require_admin_approval_after_user_signup` setting is turned on' do
before do
stub_application_setting(require_admin_approval_after_user_signup: true)
......@@ -126,27 +121,6 @@ RSpec.describe RegistrationsController do
end
end
context 'when the feature is disabled' do
before do
stub_feature_flags(admin_approval_for_new_user_signups: false)
end
context 'when the `require_admin_approval_after_user_signup` setting is turned on' do
before do
stub_application_setting(require_admin_approval_after_user_signup: true)
end
it 'signs up the user in `active` state' do
subject
created_user = User.find_by(email: 'new@user.com')
expect(created_user).to be_present
expect(created_user.active?).to eq(true)
end
end
end
end
context 'email confirmation' do
context 'when send_user_confirmation_email is false' do
it 'signs the user in' do
......
......@@ -132,11 +132,6 @@ RSpec.describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_n
context 'Change Sign-up restrictions' do
context 'Require Admin approval for new signup setting' do
context 'when feature is enabled' do
before do
stub_feature_flags(admin_approval_for_new_user_signups: true)
end
it 'changes the setting' do
page.within('.as-signup') do
check 'Require admin approval for new sign-ups'
......@@ -147,19 +142,6 @@ RSpec.describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_n
expect(page).to have_content "Application settings saved successfully"
end
end
context 'when feature is disabled' do
before do
stub_feature_flags(admin_approval_for_new_user_signups: false)
end
it 'does not show the the setting' do
page.within('.as-signup') do
expect(page).not_to have_selector('.application_setting_require_admin_approval_after_user_signup')
end
end
end
end
end
it 'Change Sign-in restrictions' do
......
......@@ -75,9 +75,7 @@ RSpec.describe "Admin::Users" do
end
context '`Pending approval` tab' do
context 'feature is enabled' do
before do
stub_feature_flags(admin_approval_for_new_user_signups: true)
visit admin_users_path
end
......@@ -85,18 +83,6 @@ RSpec.describe "Admin::Users" do
expect(page).to have_link('Pending approval', href: admin_users_path(filter: 'blocked_pending_approval'))
end
end
context 'feature is disabled' do
before do
stub_feature_flags(admin_approval_for_new_user_signups: false)
visit admin_users_path
end
it 'does not show the `Pending approval` tab' do
expect(page).not_to have_link('Pending approval', href: admin_users_path(filter: 'blocked_pending_approval'))
end
end
end
end
describe 'search and sort' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment