mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 15:31:19 +00:00
feat: greepy review
This commit is contained in:
@@ -291,7 +291,7 @@ export const membershipUserDALFactory = (db: TDbClient) => {
|
||||
}
|
||||
};
|
||||
|
||||
// this right nwo only support sub organization
|
||||
// this right now only support sub organization
|
||||
const listAvailableUsers = async (orgId: string, rootOrgId: string) => {
|
||||
try {
|
||||
const usersConnectedToOrg = db
|
||||
|
||||
@@ -92,10 +92,15 @@ export const newOrgMembershipUserFactory = ({
|
||||
},
|
||||
scopeOrgId: org.rootOrgId
|
||||
});
|
||||
if (rootOrgMembership.length !== newMembers.length)
|
||||
if (rootOrgMembership.length !== newMembers.length) {
|
||||
const emails = newMembers
|
||||
.filter((user) => !rootOrgMembership.find((i) => i.actorUserId === user.id))
|
||||
.map((el) => el.email)
|
||||
.join(",");
|
||||
throw new BadRequestError({
|
||||
message: "User doesn't have membership in root organization"
|
||||
message: `Users with email ${emails} doesn't have membership in root organization`
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user