2016-01-06 02:38:52 -05:00
|
|
|
class RepairLdapBlockedUserService
|
2016-01-07 11:01:01 -05:00
|
|
|
attr_accessor :user
|
2016-01-06 02:38:52 -05:00
|
|
|
|
2016-01-07 11:01:01 -05:00
|
|
|
def initialize(user)
|
|
|
|
@user = user
|
2016-01-06 02:38:52 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def execute
|
2016-01-07 11:01:01 -05:00
|
|
|
user.block if ldap_hard_blocked?
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def ldap_hard_blocked?
|
|
|
|
user.ldap_blocked? && !user.ldap_user?
|
2016-01-06 02:38:52 -05:00
|
|
|
end
|
|
|
|
end
|