File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Modules/CIPPCore/Public/Tools Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,22 @@ function Import-CommunityTemplate {
4343 $NewJSON.excludedTenants = $excludedTenants
4444 }
4545 }
46+
47+ if ($Template.PartitionKey -eq ' AppApprovalTemplate' ) {
48+ # Extract the Permission Set name,id,permissions from the JSON and add to the AppPermissions table
49+ $AppPermissionsTable = Get-CIPPTable - TableName ' AppPermissions'
50+ $Permissions = $NewJSON.Permissions
51+ $Entity = @ {
52+ ' PartitionKey' = ' Templates'
53+ ' RowKey' = $NewJSON.PermissionSetId
54+ ' TemplateName' = $NewJSON.PermissionSetName
55+ ' Permissions' = [string ]($Permissions | ConvertTo-Json - Depth 10 - Compress)
56+ ' UpdatedBy' = $NewJSON.UpdatedBy ?? $NewJSON.CreatedBy ?? ' System'
57+ }
58+ $null = Add-CIPPAzDataTableEntity @AppPermissionsTable - Entity $Entity - Force
59+ Write-Information ' Added App Permissions to AppPermissions table'
60+ }
61+
4662 # Re-compress JSON and save to table
4763 $NewJSON = [string ]($NewJSON | ConvertTo-Json - Depth 100 - Compress)
4864 $Template.JSON = $NewJSON
You can’t perform that action at this time.
0 commit comments