Skip to content

Commit a8479c0

Browse files
authored
Merge pull request #1561 from CVEProject/dr_1545
Updates to GetUsers & Added in forgotten CreateUserByOrg refactor
2 parents 729912b + c3c02cd commit a8479c0

File tree

5 files changed

+289
-269
lines changed

5 files changed

+289
-269
lines changed

src/controller/registry-org.controller/index.js

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ router.get('/registryOrg/:shortname/users',
492492
}
493493
}
494494
*/
495+
mw.useRegistry(),
495496
mw.validateUser,
496497
mw.onlySecretariat,
497498
param(['shortname']).isString().trim().notEmpty().isLength({ min: CONSTANTS.MIN_SHORTNAME_LENGTH, max: CONSTANTS.MAX_SHORTNAME_LENGTH }),
@@ -575,35 +576,11 @@ router.post('/registryOrg/:shortname/user',
575576
}
576577
}
577578
*/
578-
// mw.validateUser,
579-
// mw.onlySecretariatOrAdmin(true),
580-
// // mw.onlyOrgWithPartnerRole,
579+
mw.useRegistry(),
580+
mw.validateUser,
581581
mw.onlySecretariat,
582582
param(['shortname']).isString().trim().notEmpty().isLength({ min: CONSTANTS.MIN_SHORTNAME_LENGTH, max: CONSTANTS.MAX_SHORTNAME_LENGTH }),
583-
// body(['cve_program_org_membership']).optional().custom(isFlatStringArray), // TO-DO: implement custom(mw.isCveProgramOrgMembershipObject),
584-
body(
585-
[
586-
'user_id',
587-
'name.first',
588-
'name.last'
589-
])
590-
.isString(),
591-
body(
592-
[
593-
'name.middle',
594-
'name.suffix',
595-
'contact_info.phone',
596-
'contact_info.email' // // TO-DO: this needs to be required only when contact-info is present?
597-
])
598-
.default('')
599-
.isString(),
600-
body(['org_affiliations']) // TO-DO
601-
.optional(),
602-
body(['authority.active_roles'])
603-
.optional()
604-
.custom(isFlatStringArray)
605-
.customSanitizer(toUpperCaseArray)
606-
.custom(isOrgRole), // TO-DO: this needs to be required only when authority is present?
583+
607584
parseError,
608585
parsePostParams,
609586
controller.USER_CREATE_SINGLE)

0 commit comments

Comments
 (0)