Skip to content

Commit 0bdab93

Browse files
authored
Merge pull request #197 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 6fd2a50 + eb825f7 commit 0bdab93

File tree

6 files changed

+7
-3
lines changed

6 files changed

+7
-3
lines changed

Modules/CIPPCore/Public/Authentication/Test-CIPPAccess.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ function Test-CIPPAccess {
144144
throw "Access to this CIPP API endpoint is not allowed, you do not have the required permission: $APIRole"
145145
}
146146
if (!$TenantAllowed -and $Help.Functionality -notmatch 'AnyTenant') {
147+
Write-Information "Tenant not allowed: $TenantFilter"
147148
throw 'Access to this tenant is not allowed'
148149
} else {
149150
return $true

Modules/CIPPCore/Public/Entrypoints/Invoke-ListExtensionsConfig.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using namespace System.Net
33
Function Invoke-ListExtensionsConfig {
44
<#
55
.FUNCTIONALITY
6-
Entrypoint
6+
Entrypoint,AnyTenant
77
.ROLE
88
CIPP.Extension.Read
99
#>

Modules/CIPPCore/Public/Entrypoints/Invoke-ListGraphExplorerPresets.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using namespace System.Net
33
Function Invoke-ListGraphExplorerPresets {
44
<#
55
.FUNCTIONALITY
6-
Entrypoint
6+
Entrypoint,AnyTenant
77
.ROLE
88
CIPP.Core.Read
99
#>

Modules/CIPPCore/Public/GraphHelper/New-ExoBulkRequest.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function New-ExoBulkRequest {
8484
$IdToCmdletName[$RequestId] = $cmd.CmdletInput.CmdletName
8585
}
8686
$BatchBodyJson = ConvertTo-Json -InputObject $BatchBodyObj -Depth 10
87+
$BatchBodyJson = Get-CIPPTextReplacement -TenantFilter $tenantid -Text $BatchBodyJson
8788
$Results = Invoke-RestMethod $BatchURL -ResponseHeadersVariable responseHeaders -Method POST -Body $BatchBodyJson -Headers $Headers -ContentType 'application/json; charset=utf-8'
8889
foreach ($Response in $Results.responses) {
8990
$ReturnedData.Add($Response)

Modules/CIPPCore/Public/GraphHelper/New-ExoRequest.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function New-ExoRequest {
5454
Parameters = $Params
5555
}
5656
}
57+
$ExoBody = Get-CIPPTextReplacement -TenantFilter $tenantid -Text $ExoBody
5758

5859
$Tenant = Get-Tenants -IncludeErrors | Where-Object { $_.defaultDomainName -eq $tenantid -or $_.customerId -eq $tenantid }
5960
if (-not $Tenant -and $NoAuthCheck -eq $true) {

Modules/CIPPCore/Public/GraphHelper/New-GraphPOSTRequest.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function New-GraphPOSTRequest ($uri, $tenantid, $body, $type, $scope, $AsApp, $N
2020
$contentType = 'application/json; charset=utf-8'
2121
}
2222
try {
23+
$body = Get-CIPPTextReplacement -TenantFilter $tenantid -Text $body
2324
$ReturnedData = (Invoke-RestMethod -Uri $($uri) -Method $TYPE -Body $body -Headers $headers -ContentType $contentType -SkipHttpErrorCheck:$IgnoreErrors -ResponseHeadersVariable responseHeaders)
2425
} catch {
2526
$Message = if ($_.ErrorDetails.Message) {
@@ -37,4 +38,4 @@ function New-GraphPOSTRequest ($uri, $tenantid, $body, $type, $scope, $AsApp, $N
3738
} else {
3839
Write-Error 'Not allowed. You cannot manage your own tenant or tenants not under your scope'
3940
}
40-
}
41+
}

0 commit comments

Comments
 (0)