BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e7f4f0ae
Commit
e7f4f0ae
authored
Mar 12, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Block user if he/she was blocked in Active Directory
parent
0f144f36
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
CHANGELOG
CHANGELOG
+1
-0
access.rb
lib/gitlab/ldap/access.rb
+8
-1
access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+6
-2
No files found.
CHANGELOG
View file @
e7f4f0ae
...
@@ -59,6 +59,7 @@ v 7.9.0 (unreleased)
...
@@ -59,6 +59,7 @@ v 7.9.0 (unreleased)
- Added blue thmeme
- Added blue thmeme
- Remove annoying notice messages when create/update merge request
- Remove annoying notice messages when create/update merge request
- Allow smb:// links in Markdown text.
- Allow smb:// links in Markdown text.
- Block user if he/she was blocked in Active Directory
v 7.8.4
v 7.8.4
- Fix issue_tracker_id substitution in custom issue trackers
- Fix issue_tracker_id substitution in custom issue trackers
...
...
lib/gitlab/ldap/access.rb
View file @
e7f4f0ae
...
@@ -34,7 +34,14 @@ module Gitlab
...
@@ -34,7 +34,14 @@ module Gitlab
def
allowed?
def
allowed?
if
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
ldap_identity
.
extern_uid
,
adapter
)
if
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
ldap_identity
.
extern_uid
,
adapter
)
return
true
unless
ldap_config
.
active_directory
return
true
unless
ldap_config
.
active_directory
!
Gitlab
::
LDAP
::
Person
.
disabled_via_active_directory?
(
user
.
ldap_identity
.
extern_uid
,
adapter
)
# Block user in GitLab if he/she was blocked in AD
if
Gitlab
::
LDAP
::
Person
.
disabled_via_active_directory?
(
user
.
ldap_identity
.
extern_uid
,
adapter
)
user
.
block
unless
user
.
blocked?
false
else
true
end
else
else
false
false
end
end
...
...
spec/lib/gitlab/ldap/access_spec.rb
View file @
e7f4f0ae
...
@@ -20,6 +20,11 @@ describe Gitlab::LDAP::Access do
...
@@ -20,6 +20,11 @@ describe Gitlab::LDAP::Access do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
disabled_via_active_directory?:
true
)
}
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
disabled_via_active_directory?:
true
)
}
it
{
is_expected
.
to
be_falsey
}
it
{
is_expected
.
to
be_falsey
}
it
"should block user in GitLab"
do
access
.
allowed?
user
.
should
be_blocked
end
end
end
context
'and has no disabled flag in active diretory'
do
context
'and has no disabled flag in active diretory'
do
...
@@ -38,4 +43,4 @@ describe Gitlab::LDAP::Access do
...
@@ -38,4 +43,4 @@ describe Gitlab::LDAP::Access do
end
end
end
end
end
end
end
end
\ No newline at end of file
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