Add user.getAllAdmins()

This commit is contained in:
Johannes Zellner
2016-01-15 16:04:33 +01:00
parent 1cdb954967
commit ecd91e8f2a

View File

@@ -13,6 +13,7 @@ exports = module.exports = {
get: getUser,
getByResetToken: getByResetToken,
changeAdmin: changeAdmin,
getAllAdmins: getAllAdmins,
resetPasswordByIdentifier: resetPasswordByIdentifier,
setPassword: setPassword,
changePassword: changePassword,
@@ -291,6 +292,15 @@ function changeAdmin(username, admin, callback) {
});
}
function getAllAdmins(callback) {
assert.strictEqual(typeof callback, 'function');
userdb.getAllAdmins(function (error, admins) {
if (error) return callback(new UserError(UserError.INTERNAL_ERROR, error));
callback(null, admins);
});
}
function resetPasswordByIdentifier(identifier, callback) {
assert.strictEqual(typeof identifier, 'string');
assert.strictEqual(typeof callback, 'function');