Commit be1120e9 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Improve ad_disabled method name

parent a966f722
......@@ -15,7 +15,7 @@ module Gitlab
def allowed?(user)
if Gitlab::LDAP::Person.find_by_dn(user.extern_uid, adapter)
!Gitlab::LDAP::Person.ad_disabled?(user.extern_uid, adapter)
!Gitlab::LDAP::Person.active_directory_disabled?(user.extern_uid, adapter)
else
false
end
......
......@@ -16,7 +16,7 @@ module Gitlab
adapter.user('dn', dn)
end
def self.ad_disabled?(dn, adapter=nil)
def self.active_directory_disabled?(dn, adapter=nil)
adapter ||= Gitlab::LDAP::Adapter.new
adapter.dn_matches_filter?(dn, AD_USER_DISABLED)
end
......
......@@ -17,13 +17,13 @@ describe Gitlab::LDAP::Access 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(ad_disabled?: true) }
before { Gitlab::LDAP::Person.stub(active_directory_disabled?: true) }
it { should be_false }
end
context 'and the Active Directory disabled flag is not set' do
before { Gitlab::LDAP::Person.stub(ad_disabled?: false) }
before { Gitlab::LDAP::Person.stub(active_directory_disabled?: false) }
it { should be_true }
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment