transfer ownership is not used anymore

This commit is contained in:
Girish Ramakrishnan
2022-05-26 14:30:32 -07:00
parent c9916c4107
commit 5b075e3918
3 changed files with 0 additions and 26 deletions

View File

@@ -10,7 +10,6 @@ exports = module.exports = {
verifyPassword,
setGroups,
setGhost,
makeOwner,
makeLocal,
getPasswordResetLink,
@@ -202,20 +201,6 @@ async function setPassword(req, res, next) {
next(new HttpSuccess(204));
}
// This route transfers ownership from token user to user specified in path param
async function makeOwner(req, res, next) {
assert.strictEqual(typeof req.resource, 'object');
// first make new one owner, then demote current one
let [error] = await safe(users.update(req.resource, { role: users.ROLE_OWNER }, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
[error] = await safe(users.update(req.user, { role: users.ROLE_USER }, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(204));
}
async function makeLocal(req, res, next) {
assert.strictEqual(typeof req.resource, 'object');