File tree Expand file tree Collapse file tree 4 files changed +14
-11
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Endpoint/Applications Expand file tree Collapse file tree 4 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 1- Function Invoke-AddChocoApp {
1+ function Invoke-AddChocoApp {
22 <#
33 . FUNCTIONALITY
4- Entrypoint
4+ Entrypoint,AnyTenant
55 . ROLE
66 Endpoint.Application.ReadWrite
77 #>
@@ -30,7 +30,9 @@ Function Invoke-AddChocoApp {
3030 $intuneBody.detectionRules [0 ].path = " $ ( $ENV: SystemDrive ) \programdata\chocolatey\lib"
3131 $intuneBody.detectionRules [0 ].fileOrFolderName = " $ ( $ChocoApp.PackageName ) "
3232
33- $Tenants = $Request.Body.selectedTenants.defaultDomainName
33+ $AllowedTenants = Test-CIPPAccess - Request $Request - TenantList
34+ $Tenants = ($Request.Body.selectedTenants | Where-Object { $AllowedTenants -contains $_.customerId -or $AllowedTenants -contains ' AllTenants' }).defaultDomainName
35+
3436 $Results = foreach ($Tenant in $Tenants ) {
3537 try {
3638 # Apply CIPP text replacement for tenant-specific variables
Original file line number Diff line number Diff line change 11function Invoke-AddMSPApp {
22 <#
33 . FUNCTIONALITY
4- Entrypoint
4+ Entrypoint,AnyTenant
55 . ROLE
66 Endpoint.Application.ReadWrite
77 #>
@@ -17,7 +17,8 @@ function Invoke-AddMSPApp {
1717 $intuneBody = Get-Content " AddMSPApp\$ ( $RMMApp.RMMName.value ) .app.json" | ConvertFrom-Json
1818 $intuneBody.displayName = $RMMApp.DisplayName
1919
20- $Tenants = $Request.Body.selectedTenants
20+ $AllowedTenants = Test-CIPPAccess - Request $Request - TenantList
21+ $Tenants = $Request.Body.selectedTenants | Where-Object { $AllowedTenants -contains $_.customerId -or $AllowedTenants -contains ' AllTenants' }
2122 $Results = foreach ($Tenant in $Tenants ) {
2223 $InstallParams = [PSCustomObject ]$RMMApp.params
2324 switch ($RMMApp.RMMName.value ) {
Original file line number Diff line number Diff line change 11function Invoke-AddOfficeApp {
22 <#
33 . FUNCTIONALITY
4- Entrypoint
4+ Entrypoint,AnyTenant
55 . ROLE
66 Endpoint.Application.ReadWrite
77 #>
88 [CmdletBinding ()]
99 param ($Request , $TriggerMetadata )
10-
10+ $AllowedTenants = Test-CIPPAccess - Request $Request - TenantList
11+ $Tenants = ($Request.Body.selectedTenants | Where-Object { $AllowedTenants -contains $_.customerId -or $AllowedTenants -contains ' AllTenants' }).defaultDomainName
1112 # Input bindings are passed in via param block.
12- $Tenants = $Request.Body.selectedTenants.defaultDomainName
1313 $Headers = $Request.Headers
1414 $APIName = $Request.Params.CIPPEndpoint
1515 if (' AllTenants' -in $Tenants ) { $Tenants = (Get-Tenants ).defaultDomainName }
Original file line number Diff line number Diff line change 11function Invoke-AddStoreApp {
22 <#
33 . FUNCTIONALITY
4- Entrypoint
4+ Entrypoint,AnyTenant
55 . ROLE
66 Endpoint.Application.ReadWrite
77 #>
@@ -26,8 +26,8 @@ function Invoke-AddStoreApp {
2626 ' runAsAccount' = ' system'
2727 }
2828 }
29-
30- $Tenants = $Request.body .selectedTenants.defaultDomainName
29+ $AllowedTenants = Test-CIPPAccess - Request $Request - TenantList
30+ $Tenants = ( $Request.Body .selectedTenants | Where-Object { $AllowedTenants -contains $_ .customerId -or $AllowedTenants -contains ' AllTenants ' }) .defaultDomainName
3131 $Results = foreach ($Tenant in $Tenants ) {
3232 try {
3333 $CompleteObject = [PSCustomObject ]@ {
You can’t perform that action at this time.
0 commit comments