summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Willem van der Meer <mail@jewilmeer.nl>2014-09-01 16:35:18 +0200
committerJan-Willem van der Meer <mail@jewilmeer.nl>2014-09-01 16:35:18 +0200
commitc0323b40ee5633f2808f52f98bde0509a2f3ee59 (patch)
tree9c587c3fa7bddf11f09fee0b0e119fb2708cf071
parent26b14dd2d597d7bd5579cfcbad456abb0af6a5e5 (diff)
downloadgitlab-ce-c0323b40ee5633f2808f52f98bde0509a2f3ee59.tar.gz
Refactor: beter naming for active directory disabled users
-rw-r--r--lib/gitlab/ldap/access.rb2
-rw-r--r--lib/gitlab/ldap/person.rb2
-rw-r--r--spec/lib/gitlab/ldap/access_spec.rb8
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitlab/ldap/access.rb b/lib/gitlab/ldap/access.rb
index 62709a12942..c054b6f5865 100644
--- a/lib/gitlab/ldap/access.rb
+++ b/lib/gitlab/ldap/access.rb
@@ -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
diff --git a/lib/gitlab/ldap/person.rb b/lib/gitlab/ldap/person.rb
index 9ad6618bd46..87c3d711db4 100644
--- a/lib/gitlab/ldap/person.rb
+++ b/lib/gitlab/ldap/person.rb
@@ -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
diff --git a/spec/lib/gitlab/ldap/access_spec.rb b/spec/lib/gitlab/ldap/access_spec.rb
index d8c107502ba..2307a03f656 100644
--- a/spec/lib/gitlab/ldap/access_spec.rb
+++ b/spec/lib/gitlab/ldap/access_spec.rb
@@ -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