Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ff550f47
Commit
ff550f47
authored
Aug 31, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return 404 when LDAP is disabled or not in license
parent
fcd0b3fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/controllers/groups/ldaps_controller.rb
app/controllers/groups/ldaps_controller.rb
+1
-1
lib/api/groups.rb
lib/api/groups.rb
+1
-1
spec/requests/api/groups_spec.rb
spec/requests/api/groups_spec.rb
+2
-2
No files found.
app/controllers/groups/ldaps_controller.rb
View file @
ff550f47
...
...
@@ -17,6 +17,6 @@ class Groups::LdapsController < Groups::ApplicationController
private
def
check_enabled_extras!
render_40
3
unless
Gitlab
::
LDAP
::
Config
.
enabled_extras?
render_40
4
unless
Gitlab
::
LDAP
::
Config
.
enabled_extras?
end
end
lib/api/groups.rb
View file @
ff550f47
...
...
@@ -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
...
...
spec/requests/api/groups_spec.rb
View file @
ff550f47
...
...
@@ -749,10 +749,10 @@ describe API::Groups do
allow
(
Gitlab
::
LDAP
::
Config
).
to
receive
(
:enabled_extras?
).
and_return
(
false
)
end
it
'returns 40
3
'
do
it
'returns 40
4 (same as CE would)
'
do
ldap_sync
(
group1
.
id
,
admin
,
:disable!
)
expect
(
response
).
to
have_http_status
(
40
3
)
expect
(
response
).
to
have_http_status
(
40
4
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment