Commit be1120e9681bfb83084c7aeadae3e83692901de9

Authored by Jacob Vosmaer
1 parent a966f722

Improve ad_disabled method name

lib/gitlab/ldap/access.rb
@@ -15,7 +15,7 @@ module Gitlab @@ -15,7 +15,7 @@ module Gitlab
15 15
16 def allowed?(user) 16 def allowed?(user)
17 if Gitlab::LDAP::Person.find_by_dn(user.extern_uid, adapter) 17 if Gitlab::LDAP::Person.find_by_dn(user.extern_uid, adapter)
18 - !Gitlab::LDAP::Person.ad_disabled?(user.extern_uid, adapter) 18 + !Gitlab::LDAP::Person.active_directory_disabled?(user.extern_uid, adapter)
19 else 19 else
20 false 20 false
21 end 21 end
lib/gitlab/ldap/person.rb
@@ -16,7 +16,7 @@ module Gitlab @@ -16,7 +16,7 @@ module Gitlab
16 adapter.user('dn', dn) 16 adapter.user('dn', dn)
17 end 17 end
18 18
19 - def self.ad_disabled?(dn, adapter=nil) 19 + def self.active_directory_disabled?(dn, adapter=nil)
20 adapter ||= Gitlab::LDAP::Adapter.new 20 adapter ||= Gitlab::LDAP::Adapter.new
21 adapter.dn_matches_filter?(dn, AD_USER_DISABLED) 21 adapter.dn_matches_filter?(dn, AD_USER_DISABLED)
22 end 22 end
spec/lib/gitlab/ldap/ldap_access_spec.rb
@@ -17,13 +17,13 @@ describe Gitlab::LDAP::Access do @@ -17,13 +17,13 @@ describe Gitlab::LDAP::Access do
17 before { Gitlab::LDAP::Person.stub(find_by_dn: :ldap_user) } 17 before { Gitlab::LDAP::Person.stub(find_by_dn: :ldap_user) }
18 18
19 context 'and the Active Directory disabled flag is set' do 19 context 'and the Active Directory disabled flag is set' do
20 - before { Gitlab::LDAP::Person.stub(ad_disabled?: true) } 20 + before { Gitlab::LDAP::Person.stub(active_directory_disabled?: true) }
21 21
22 it { should be_false } 22 it { should be_false }
23 end 23 end
24 24
25 context 'and the Active Directory disabled flag is not set' do 25 context 'and the Active Directory disabled flag is not set' do
26 - before { Gitlab::LDAP::Person.stub(ad_disabled?: false) } 26 + before { Gitlab::LDAP::Person.stub(active_directory_disabled?: false) }
27 27
28 it { should be_true } 28 it { should be_true }
29 end 29 end