Commit 923cad0e authored by Sean McGivern's avatar Sean McGivern

Merge branch 'rd-3225-member-lock-works-with-ee-9-5-without-license' into 'master'

Don't show Member Lock setting for unlicensed system

Closes #3225

See merge request gitlab-org/gitlab-ee!4355
parents 12bdc1d7 4f1a16ac
......@@ -44,14 +44,7 @@
= render 'group_admin_settings', f: f
.form-group
%hr
= f.label :membership_lock, class: 'control-label' do
Member lock
.col-sm-10
.checkbox
= f.check_box :membership_lock
%span.descr Prevent adding new members to project membership within this group
= render 'member_lock_setting', f: f, group: @group
.form-actions
= f.submit 'Save group', class: "btn btn-save"
......
---
title: Don't show Member Lock setting for unlicensed system
merge_request: 4355
author:
type: fixed
......@@ -18,6 +18,7 @@ class License < ActiveRecord::Base
issue_weights
jenkins_integration
ldap_group_sync
member_lock
merge_request_approvers
merge_request_squash
multiple_ldap_servers
......
- return unless can?(current_user, :admin_group, group) && License.feature_available?(:member_lock)
.form-group
%hr
= f.label :membership_lock, class: 'control-label' do
Member lock
.col-sm-10
.checkbox
= f.check_box :membership_lock
%span.descr Prevent adding new members to project membership within this group
......@@ -2,10 +2,12 @@ require 'spec_helper'
feature 'Edit group settings' do
given(:user) { create(:user) }
given(:developer) { create(:user) }
given(:group) { create(:group, path: 'foo') }
background do
group.add_owner(user)
group.add_developer(developer)
sign_in(user)
end
......@@ -52,4 +54,38 @@ feature 'Edit group settings' do
expect(page).not_to have_content('Allowed to create projects')
end
end
describe 'Member Lock setting' do
context 'without a license key' do
before do
License.delete_all
end
it 'is not visible' do
visit edit_group_path(group)
expect(page).not_to have_content('Member lock')
end
end
context 'with a license key' do
it 'is visible' do
visit edit_group_path(group)
expect(page).to have_content('Member lock')
end
context 'when current user is not the Owner' do
before do
sign_in(developer)
end
it 'is not visible' do
visit edit_group_path(group)
expect(page).not_to have_content('Member lock')
end
end
end
end
end
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