notifications: send backup fail only to owner

only superadmin has access to server and can adjust backup config
This commit is contained in:
Girish Ramakrishnan
2021-04-19 20:52:10 -07:00
parent 613da5fff9
commit 0c8e0c4715
3 changed files with 45 additions and 18 deletions

View File

@@ -16,6 +16,7 @@ exports = module.exports = {
getByResetToken,
getByUsername,
getAdmins,
getSuperadmins,
setPassword,
update,
createOwner,
@@ -496,6 +497,16 @@ function getAdmins(callback) {
});
}
function getSuperadmins(callback) {
assert.strictEqual(typeof callback, 'function');
userdb.getByRole(exports.ROLE_OWNER, function (error, owners) {
if (error) return callback(error);
callback(null, owners);
});
}
function sendPasswordResetByIdentifier(identifier, callback) {
assert.strictEqual(typeof identifier, 'string');
assert.strictEqual(typeof callback, 'function');