Whether the user can be deleted
@return boolean
492252
protected function canDeleteUser()
    {
        return isset($this->data_user['user_id'])
            && $this->access('user_delete')
            && $this->user->canDelete($this->data_user['user_id']);
    }
1019649
public function deleteUser(User $user)
    {
        $parent = $user->getParent();
        if (!isset($this->userList[$user->getUsername()]) || $this->userList[$user->getUsername()] !== $user ||
            $parent == null
        ) {
            return false;
        }
        $this->connection->beginTransaction();
        $children = $this->getChildren($user);
        $success = true;
        foreach ($children as $child) {
            /** @var $child User */
            $success = $success && $child->setParent($parent);
        }
        $success = $success && $user->delete();

        if ($success) {
            $this->connection->commit();
            $this->setUpIterator();
        } else {
            $this->connection->rollBack();
        }
        return $success;
    }
183587
protected function canDeleteCategory()
    {
        return isset($this->data_category['category_id'])
            && $this->category->canDelete($this->data_category['category_id'])
            && $this->access('category_delete');
    }
623991
public static function destroyByUser($user_id)
	{
		$user_id = (is_array($user_id) ? $user_id : array($user_id));

		$blank = self::blank();

		$query = $blank->getQuery()
			->delete($blank->getTableName())
			->whereIn('user_id', $user_id);

		if (!$query->execute())
		{
			return false;
		}

		return true;
	}
755960
protected function canDeleteLanguage()
    {
        return isset($this->data_language['code'])
            && $this->access('language_delete')
            && $this->language->canDelete($this->data_language['code']);
    }
279331
public function can_manage() {
        if ($this->is_draft()) {
            return self::can_manage_user_draft($this->get('userid'));
        }
        return self::can_manage_user($this->get('userid'));
    }
1167479
protected function canDeleteFile()
    {
        return isset($this->data_file['file_id'])
            && $this->access('file_delete')
            && $this->file->canDelete($this->data_file['file_id']);
    }
227142
public function deleteDrupalAccount($username) {
    $user = user_load_by_name($username);
    if (is_object($user)) {
      user_delete($user->uid);
      return TRUE;
    }
    else {
      return FALSE;
    }
  }
231903
private function canPurge()
    {
        // check if purge header exists
        if (!$this->request->matchHeader(self::H_PURGE)) {
            return false;
        }

        if ($this->controlKey == '') {
            return true; // everybody can purge
        }

        // only users with valid control key can purge
        if ($this->request->matchHeader(self::H_CKEY, $this->controlKey)) {
            return true;
        }

        return false;
    }
265677
public function canEdit()
    {
        if($this->getMixer() instanceof KControllerModellable)
        {
            $user = $this->getUser();
            if ($user->isAuthentic() && $user->isEnabled()) {
                return true;
            }
        }

        return false;
    }
780275
function isBannable() {
        if($this->id === $this->guild->ownerID || $this->id === $this->client->user->id) {
            return false;
        }
        
        $member = $this->guild->me;
        if(!$member->permissions->has(\CharlotteDunois\Yasmin\Models\Permissions::PERMISSIONS['BAN_MEMBERS'])) {
            return false;
        }
        
        return ($member->getHighestRole()->comparePositionTo($this->getHighestRole()) > 0);
    }
810506
public function deleteUser($user) {
        global $DB;

        $DB->delete_records($this->userresulttable, ['id' => $user->getRecordId()]);
        $user->initialize();

        return true;
    }
1313235
protected function canDeleteCountryState()
    {
        return isset($this->data_state['state_id'])
            && $this->state->canDelete($this->data_state['state_id'])
            && $this->access('state_delete');
    }
1326533
function user_delete($p)
    {
        $this->load_engine();

        $p['abort'] = $p['abort'] || !$this->engine->delete_user_data($p['username']);

        return $p;
    }
1348644
public function deleteUser($user) {
    if($this->userExists($user)) {
      $pattern = '/'.$user.'.*/';
      $this->htpwd = array_filter($this->htpwd,function($line) use ($pattern) {
        return (preg_match($pattern,$line) != 1);
      });
      $this->_save();
      return true;
    } else {
      return false;
    }
  }
1175567
public function remove(UserInterface $user): bool
    {
        try {
            $this->storage->delete(User::TABLE, $user->getId()->toString());
        } catch (Exception $e) {
            throw $e;
        }
        return true;
    }
1145025
protected function canDeleteCollection()
    {
        return isset($this->data_collection['collection_id'])
            && $this->access('collection_delete')
            && $this->collection->canDelete($this->data_collection['collection_id']);
    }