summaryrefslogtreecommitdiff
path: root/app/services/repair_ldap_blocked_user_service.rb
blob: 6ed42054ac3ecb3d4ab2542c99e954bcbe15932f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class RepairLdapBlockedUserService
  attr_accessor :user

  def initialize(user)
    @user = user
  end

  def execute
    user.block if ldap_hard_blocked?
  end

  private

  def ldap_hard_blocked?
    user.ldap_blocked? && !user.ldap_user?
  end
end