mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 11:38:55 +00:00
feat(groups): unique names
This commit is contained in:
@@ -790,6 +790,18 @@ export const scimServiceFactory = ({
|
||||
});
|
||||
|
||||
const newGroup = await groupDAL.transaction(async (tx) => {
|
||||
const conflictingGroup = await groupDAL.findOne({
|
||||
name: displayName,
|
||||
orgId
|
||||
});
|
||||
|
||||
if (conflictingGroup) {
|
||||
throw new ScimRequestError({
|
||||
detail: `Group with name '${displayName}' already exists in the organization`,
|
||||
status: 409
|
||||
});
|
||||
}
|
||||
|
||||
const group = await groupDAL.create(
|
||||
{
|
||||
name: displayName,
|
||||
|
||||
Reference in New Issue
Block a user