Skip to content

Commit 6d6a4f2

Browse files
feat(groups): add disable nesting option for group creation
Introduce a new boolean property `disableNesting` in the group creation form and API, allowing users to prevent other groups from being added as members. This feature applies specifically to Graph-created groups such as generic, azurerole, m365, and dynamic. Update the frontend form to include a switch for this option. Synced from CyberDrain/CIPP@1e7e059
1 parent af140b8 commit 6d6a4f2

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎Config/openapi.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3186,6 +3186,10 @@
31863186
"type": "boolean",
31873187
"description": "(auto) from CippAddGroupForm.jsx"
31883188
},
3189+
"disableNesting": {
3190+
"type": "boolean",
3191+
"description": "Optional. When true, prevents other groups from being added as members. Only applies to Graph-created groups (generic, azurerole, m365, dynamic)."
3192+
},
31893193
"primDomain": {
31903194
"allOf": [
31913195
{

‎Modules/CIPPCore/Public/New-CIPPGroup.ps1‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ function New-CIPPGroup {
118118
'isAssignableToRole' = ($NormalizedGroupType -eq 'AzureRole')
119119
}
120120

121+
if ($GroupObject.disableNesting -eq $true) {
122+
$BodyParams | Add-Member -NotePropertyName 'disableNesting' -NotePropertyValue $true
123+
}
124+
121125
# Handle dynamic membership
122126
if ($GroupObject.membershipRules) {
123127
$BodyParams | Add-Member -NotePropertyName 'membershipRule' -NotePropertyValue $GroupObject.membershipRules

0 commit comments

Comments
 (0)