Commit ff550f47 authored by Michael Kozono's avatar Michael Kozono

Return 404 when LDAP is disabled or not in license

parent fcd0b3fb
......@@ -17,6 +17,6 @@ class Groups::LdapsController < Groups::ApplicationController
private
def check_enabled_extras!
render_403 unless Gitlab::LDAP::Config.enabled_extras?
render_404 unless Gitlab::LDAP::Config.enabled_extras?
end
end
......@@ -204,7 +204,7 @@ module API
desc 'Sync a group with LDAP.'
post ":id/ldap_sync" do
forbidden!('LDAP is disabled, or LDAP extras are disabled for this license') unless Gitlab::LDAP::Config.enabled_extras?
not_found! unless Gitlab::LDAP::Config.enabled_extras?
group = find_group!(params[:id])
authorize! :admin_group, group
......
......@@ -749,10 +749,10 @@ describe API::Groups do
allow(Gitlab::LDAP::Config).to receive(:enabled_extras?).and_return(false)
end
it 'returns 403' do
it 'returns 404 (same as CE would)' do
ldap_sync(group1.id, admin, :disable!)
expect(response).to have_http_status(403)
expect(response).to have_http_status(404)
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