Skip to content

Commit 26cca6e

Browse files
committed
I've got a secret, that I have been hiding, under my skin
1 parent fc94c3a commit 26cca6e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/controller/org.controller/org.controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ async function updateUser (req, res, next) {
906906
if (shortNameParams !== requesterShortName && !isRequesterSecretariat) {
907907
logger.info({ uuid: req.ctx.uuid, message: `${shortNameParams} organization data can only be modified by users of the same organization or the Secretariat.` })
908908
await session.abortTransaction(); await session.endSession()
909-
return res.status(403).json(error.notSameOrgOrSecretariat())
909+
return res.status(403).json(error.notSameUserOrSecretariat())
910910
}
911911

912912
const userLeg = await userLegRepo.findOneByUserNameAndOrgUUID(usernameParams, targetOrgLegUUID, null, { session })
@@ -1286,8 +1286,8 @@ async function resetSecret (req, res, next) {
12861286
return res.status(404).json(error.userDne(username))
12871287
}
12881288

1289-
const isLegAdmin = await userRepo.isAdmin(requesterUsername, requesterShortName, { session })
1290-
const isRegAdmin = await userRegistryRepo.isAdmin(requesterUsername, orgRegUUID, { session })
1289+
const isLegAdmin = await userRepo.isAdmin(requesterUsername, requesterShortName, false, { session })
1290+
const isRegAdmin = await userRegistryRepo.isAdmin(requesterUsername, requesterShortName, true, { session })
12911291
const isAdmin = isLegAdmin && isRegAdmin
12921292

12931293
// check if the user is not the requester or if the requester is not a secretariat

0 commit comments

Comments
 (0)