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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
c0323b40
Commit
c0323b40
authored
Sep 01, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor: beter naming for active directory disabled users
parent
26b14dd2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+1
-1
lib/gitlab/ldap/person.rb
lib/gitlab/ldap/person.rb
+1
-1
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+4
-4
No files found.
lib/gitlab/ldap/access.rb
View file @
c0323b40
...
...
@@ -28,7 +28,7 @@ module Gitlab
def
allowed?
(
user
)
if
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
extern_uid
,
adapter
)
!
Gitlab
::
LDAP
::
Person
.
active_directory_disabled
?
(
user
.
extern_uid
,
adapter
)
!
Gitlab
::
LDAP
::
Person
.
disabled_via_active_directory
?
(
user
.
extern_uid
,
adapter
)
else
false
end
...
...
lib/gitlab/ldap/person.rb
View file @
c0323b40
...
...
@@ -16,7 +16,7 @@ module Gitlab
adapter
.
user
(
'dn'
,
dn
)
end
def
self
.
active_directory_disabled
?
(
dn
,
adapter
=
nil
)
def
self
.
disabled_via_active_directory
?
(
dn
,
adapter
=
nil
)
adapter
||=
Gitlab
::
LDAP
::
Adapter
.
new
adapter
.
dn_matches_filter?
(
dn
,
AD_USER_DISABLED
)
end
...
...
spec/lib/gitlab/ldap/access_spec.rb
View file @
c0323b40
...
...
@@ -16,14 +16,14 @@ describe Gitlab::LDAP::Access do
context
'when the user is found'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
find_by_dn: :ldap_user
)
}
context
'and the
Active Directory disabled flag is set
'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
active_directory_disabled
?:
true
)
}
context
'and the
user is diabled via active directory
'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
disabled_via_active_directory
?:
true
)
}
it
{
should
be_false
}
end
context
'and
the Active Directory disabled flag is not set
'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
active_directory_disabled
?:
false
)
}
context
'and
has no disabled flag in active diretory
'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
disabled_via_active_directory
?:
false
)
}
it
{
should
be_true
}
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