Magento 2: how to enable and disable customer?

I am looking for code how the customer can be enabled and disabled using customer Id in Magento 2.

When customer is disabled we should not allow customer to login from front end.

I tried setting is_active column as 0 in Database then also i can able to login from frontend.

I am using below code

  public function execute(){      $  user = $  this->customerFactory->create();         $  userId = $  this->getRequest()->getParam('user_id', false);         $  status = 0;         if($  userId):           $  user->load($  userId)->setWebsiteId($  oldUser->getWebsiteId());               endif;       try {                  $  user->setIsActive($  status);             $  user->save();            }catch (\Exception $  e){            $  this->_messageManager->addError(__('Can\'t save user'));          }   } 

is that can be done pro grammatically?