Commit be1120e9681bfb83084c7aeadae3e83692901de9
1 parent
a966f722
Exists in
spb-stable
and in
2 other branches
Improve ad_disabled method name
Showing
3 changed files
with
4 additions
and
4 deletions
Show diff stats
lib/gitlab/ldap/access.rb
| ... | ... | @@ -15,7 +15,7 @@ module Gitlab |
| 15 | 15 | |
| 16 | 16 | def allowed?(user) |
| 17 | 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 | 19 | else |
| 20 | 20 | false |
| 21 | 21 | end | ... | ... |
lib/gitlab/ldap/person.rb
| ... | ... | @@ -16,7 +16,7 @@ module Gitlab |
| 16 | 16 | adapter.user('dn', dn) |
| 17 | 17 | end |
| 18 | 18 | |
| 19 | - def self.ad_disabled?(dn, adapter=nil) | |
| 19 | + def self.active_directory_disabled?(dn, adapter=nil) | |
| 20 | 20 | adapter ||= Gitlab::LDAP::Adapter.new |
| 21 | 21 | adapter.dn_matches_filter?(dn, AD_USER_DISABLED) |
| 22 | 22 | end | ... | ... |
spec/lib/gitlab/ldap/ldap_access_spec.rb
| ... | ... | @@ -17,13 +17,13 @@ describe Gitlab::LDAP::Access do |
| 17 | 17 | before { Gitlab::LDAP::Person.stub(find_by_dn: :ldap_user) } |
| 18 | 18 | |
| 19 | 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 | 22 | it { should be_false } |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | 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 | 28 | it { should be_true } |
| 29 | 29 | end | ... | ... |