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