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
8271fac0
Commit
8271fac0
authored
Oct 10, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make AD check for access work properly
parent
adee3091
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
15 deletions
+12
-15
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+2
-3
lib/gitlab/ldap/config.rb
lib/gitlab/ldap/config.rb
+4
-0
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+6
-12
No files found.
lib/gitlab/ldap/access.rb
View file @
8271fac0
...
...
@@ -36,9 +36,8 @@ module Gitlab
def
allowed?
if
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
extern_uid
,
adapter
)
if
ldap_config
.
active_directory
!
Gitlab
::
LDAP
::
Person
.
disabled_via_active_directory?
(
user
.
extern_uid
,
adapter
)
end
return
true
unless
ldap_config
.
active_directory
!
Gitlab
::
LDAP
::
Person
.
disabled_via_active_directory?
(
user
.
extern_uid
,
adapter
)
else
false
end
...
...
lib/gitlab/ldap/config.rb
View file @
8271fac0
...
...
@@ -60,6 +60,10 @@ module Gitlab
options
[
'admin_group'
]
end
def
active_directory
options
[
'active_directory'
]
end
protected
def
base_config
Gitlab
.
config
.
ldap
...
...
spec/lib/gitlab/ldap/access_spec.rb
View file @
8271fac0
...
...
@@ -28,19 +28,13 @@ describe Gitlab::LDAP::Access do
it
{
should
be_true
}
end
context
'and has no disabled flag in active diretory'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
disabled_via_active_directory?:
false
)
Gitlab
.
config
.
ldap
[
'enabled'
]
=
true
Gitlab
.
config
.
ldap
[
'active_directory'
]
=
false
}
after
{
Gitlab
.
config
.
ldap
[
'enabled'
]
=
false
Gitlab
.
config
.
ldap
[
'active_directory'
]
=
true
}
context
'withoud ActiveDirectory enabled'
do
before
do
Gitlab
::
LDAP
::
Config
.
stub
(
enabled?:
true
)
Gitlab
::
LDAP
::
Config
.
any_instance
.
stub
(
active_directory:
false
)
end
it
{
should
be_
fals
e
}
it
{
should
be_
tru
e
}
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