modules/orionode/lib/metastore/mongodb/store.js
function deleteUser(id, callback) {
		orionAccount.findByUsername(id, function(err, user) {
			if(err) {
				callback(err);
			}
			const userPath = path.join(this.options.workspaceDir, id.substring(0,2));
			fs.access(userPath, (err) => {
				if(err) {
					callback(err);
				}
				//TODO should a delete failure prevent the user delete?
				return rimraf(userPath, (err) => {
					if(err) {
						callback(err);
					}
					orionAccount.remove({username: id}, callback);
				});
			});
		}.bind(this));
	}
function deleteUser(id, callback) {
		orionAccount.findByUsername(id, function(err, user) {
			if(err) {
				callback(err);
			}
			const userPath = path.join(this.options.workspaceDir, id.substring(0,2));
			fs.access(userPath, (err) => {
				if(err) {
					callback(err);
				}
				//TODO should a delete failure prevent the user delete?
				return rimraf(userPath, (err) => {
					if(err) {
						callback(err);
					}
					orionAccount.remove({username: id}, callback);
				});
			});
		}.bind(this));
	}
function deleteUser ( id , callback ) { orionAccount . findByUsername ( id , function ( err , user ) { if ( err ) { callback ( err ) ; } const userPath = path . join ( this . options . workspaceDir , id . substring ( 0 , 2 ) ) ; fs . access ( userPath , ( err ) => { if ( err ) { callback ( err ) ; } //TODO should a delete failure prevent the user delete? return rimraf ( userPath , ( err ) => { if ( err ) { callback ( err ) ; } orionAccount . remove ( { username : id } , callback ) ; } ) ; } ) ; } . bind ( this ) ) ; }
Delete the user from the store with the given user ID
@param {string} id The user identifier to delete
@param {fn(Error: err)} callback The callback to call when complete
Delete the user from the store with the given user ID