Skip to content

Commit 6714271

Browse files
committed
fixing lint issues
1 parent 517c372 commit 6714271

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

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

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ const mongoose = require('mongoose')
33
const logger = require('../../middleware/logger')
44
const getConstants = require('../../constants').getConstants
55
const errors = require('./error')
6-
const { options } = require('../cve.controller')
7-
const c = require('config')
86
const error = new errors.OrgControllerError()
97
const validateUUID = require('uuid').validate
108

@@ -443,10 +441,7 @@ async function createUser (req, res, next) {
443441
try {
444442
const body = req.ctx.body
445443
const userRepo = req.ctx.repositories.getBaseUserRepository()
446-
const orgRepo = req.ctx.repositories.getBaseOrgRepository()
447444
const orgShortName = req.ctx.params.shortname
448-
const requesterShortName = req.ctx.org
449-
const requesterUsername = req.ctx.user
450445
let returnValue
451446

452447
// Do not allow the user to pass in a UUID
@@ -475,9 +470,6 @@ async function createUser (req, res, next) {
475470
return res.status(400).json(error.userExists(body?.username))
476471
}
477472

478-
const isRequesterSecretariat = await orgRepo.isSecretariatByShortName(requesterShortName, { session })
479-
const isAdmin = await userRepo.isAdmin(requesterUsername, requesterShortName, { session })
480-
481473
if (!await userRepo.isAdminOrSecretariat(orgShortName, req.ctx.user, req.ctx.org, { session }, !req.useRegistry)) {
482474
await session.abortTransaction()
483475
return res.status(403).json(error.notOrgAdminOrSecretariat()) // The Admin user must belong to the new user's organization
@@ -757,48 +749,6 @@ async function resetSecret (req, res, next) {
757749
}
758750
}
759751

760-
function setAggregateUserObj (query) {
761-
return [
762-
{
763-
$match: query
764-
},
765-
{
766-
$project: {
767-
_id: false,
768-
username: true,
769-
name: true,
770-
UUID: true,
771-
org_UUID: true,
772-
active: true,
773-
'authority.active_roles': true,
774-
time: true
775-
}
776-
}
777-
]
778-
}
779-
function setAggregateRegistryUserObj (query) {
780-
return [
781-
{
782-
$match: query
783-
},
784-
{
785-
$project: {
786-
_id: false,
787-
UUID: true,
788-
user_id: true,
789-
name: true,
790-
org_affiliations: true,
791-
cve_program_org_membership: true,
792-
created: true,
793-
created_by: true,
794-
last_updated: true,
795-
deactivation_date: true,
796-
last_active: true
797-
}
798-
}
799-
]
800-
}
801-
802752
module.exports = {
803753
ORG_ALL: getOrgs,
804754
ORG_SINGLE: getOrg,

0 commit comments

Comments
 (0)