Commit ef8694b3 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '1793-ldap-lock-owner-settings-views' into 'master'

Group LDAP settings views to unlock membership

See merge request gitlab-org/gitlab!26519
parents 20b5232c d8f31246
- page_title 'LDAP Synchronization'
%h3.page-title LDAP Group Settings
= render 'groups/ldap_group_settings/form', group: @group
%h3.page-title LDAP synchronizations
= render 'ldap_group_links/form', group: @group
= render 'ldap_group_links/ldap_group_links', group: @group
- if Feature.enabled?(:ldap_settings_unlock_groups_by_owners) && ::Gitlab::CurrentSettings.allow_group_owners_to_manage_ldap
%section.ldap-group-settings
= form_for(group, url: group_ldap_settings_url(group), method: :put) do |f|
.form-holder
.form-group.row
.col-sm-10
.form-check
= f.check_box :unlock_membership_to_ldap, class: 'form-check-input'
= f.label :unlock_membership_to_ldap, class: 'form-check-label' do
= _('Allow owners to manually add users outside of LDAP')
.form-actions
= f.submit _('Save'), class: 'btn btn-success qa-save'
# frozen_string_literal: true
require 'spec_helper'
describe 'Edit group settings', :js do
let(:user) { create(:user) }
let(:group) { create(:group, path: 'foo') }
before do
stub_licensed_features(ldap_group_sync_filter: true)
stub_feature_flags(ldap_settings_unlock_groups_by_owners: true)
allow(Gitlab.config.ldap).to receive(:enabled).and_return(true)
group.add_owner(user)
sign_in(user)
end
context 'when Admin allow owners to unlock LDAP membership' do
before do
allow(Gitlab::CurrentSettings).to receive(:allow_group_owners_to_manage_ldap).and_return(true)
visit group_ldap_group_links_path(group)
end
it 'the user is allow to change the membership lock' do
check('Allow owners to manually add users outside of LDAP')
click_on('Save')
expect(page).to have_selector('.flash-notice', text: 'LDAP settings updated')
end
end
context 'when Admin disallow owners to unlock LDAP membership' do
before do
allow(Gitlab::CurrentSettings).to receive(:allow_group_owners_to_manage_ldap).and_return(false)
visit group_ldap_group_links_path(group)
end
it "doesn't show the option to unlock the membership" do
expect(page).not_to have_content('Allow owners to manually add users outside of LDAP')
end
end
end
......@@ -1697,6 +1697,9 @@ msgstr ""
msgid "Allow only the selected protocols to be used for Git access."
msgstr ""
msgid "Allow owners to manually add users outside of LDAP"
msgstr ""
msgid "Allow projects within this group to use Git LFS"
msgstr ""
......
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