@Override public IUser deleteUser(String username, boolean force) throws SiteWhereException { Document existing = assertUser(username); if (force) { MongoCollection<Document> users = getMongoClient().getUsersCollection(); MongoPersistence.delete(users, existing); SiteWherePersistence.userDeleteLogic(username); return MongoUser.fromDocument(existing); } else { MongoSiteWhereEntity.setDeleted(existing, true); Document query = new Document(MongoUser.PROP_USERNAME, username); MongoCollection<Document> users = getMongoClient().getUsersCollection(); MongoPersistence.update(users, query, existing); return MongoUser.fromDocument(existing); } }
SiteWherePersistence.userDeleteLogic(username); return existing;