Skip to content

Commit 5d886c8

Browse files
committed
more documentation
1 parent 3969e11 commit 5d886c8

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ async function deleteOrg (req, res, next) {
432432
* @param {object} req - The Express request object, containing the organization shortname in `req.ctx.params.shortname`.
433433
* @param {object} res - The Express response object.
434434
* @param {function} next - The next middleware function.
435-
* @returns {Promise<void>} - A promise that resolves when the response is sent.
435+
* @returns {Promise<void>} - A promise that resolves when the response is sent. Response body includes 'role' field for admins.
436436
* @description All registered users can access this endpoint. Regular, CNA & Admin Users can retrieve information about users in the same organization.
437437
* Secretariat can retrieve all user information for any organization.
438438
* Called by GET /api/registryOrg/:shortname/users

src/controller/registry-user.controller/registry-user.controller.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ const error = new errors.UserControllerError()
66
const validateUUID = require('uuid').validate
77
const _ = require('lodash')
88

9+
/**
10+
* Retrieves information about all registry users.
11+
*
12+
* @async
13+
* @function getAllUsers
14+
* @param {object} req - The Express request object.
15+
* @param {object} res - The Express response object.
16+
* @param {function} next - The next middleware function.
17+
* @returns {Promise<void>} - A promise that resolves when the response is sent. Response body includes 'role' field for admins.
18+
* @description This endpoint is accessible to Secretariat only. It retrieves a list of all registry users.
19+
* Called by GET /api/registryUser
20+
*/
921
async function getAllUsers (req, res, next) {
1022
try {
1123
const CONSTANTS = getConstants()
@@ -60,6 +72,18 @@ async function getAllUsers (req, res, next) {
6072
}
6173
}
6274

75+
/**
76+
* Retrieves information about a specific registry user.
77+
*
78+
* @async
79+
* @function getUser
80+
* @param {object} req - The Express request object.
81+
* @param {object} res - The Express response object.
82+
* @param {function} next - The next middleware function.
83+
* @returns {Promise<void>} - A promise that resolves when the response is sent. Response body includes 'role' field for admins.
84+
* @description All authenticated users can access this endpoint. It retrieves information about the specified registry user.
85+
* Called by GET /api/registryUser/:identifier
86+
*/
6387
async function getUser (req, res, next) {
6488
/*
6589
This function is a little bit overloaded ATM until future releases of CVE-Services

0 commit comments

Comments
 (0)