Skip to content

Commit

Permalink
Merge pull request #1222 from JohnDuprey/dev
Browse files Browse the repository at this point in the history
hotfixes
  • Loading branch information
JohnDuprey authored Jan 14, 2025
2 parents 1d09cd4 + ff0fe24 commit 12082a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ Function Invoke-ExecAutoExtendGDAP {
[CmdletBinding()]
param($Request, $TriggerMetadata)

$APIName = $TriggerMetadata.FunctionName
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'

# Interact with query parameters or the body of the request.
$Results = Set-CIPPGDAPAutoExtend -RelationShipid $Request.query.ID
$Id = $Request.query.ID ?? $Request.Body.ID
$Results = Set-CIPPGDAPAutoExtend -RelationShipid $Id

# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ Function Invoke-ExecGDAPRemoveGArole {
[CmdletBinding()]
param($Request, $TriggerMetadata)

$APIName = $TriggerMetadata.FunctionName
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'

$GDAPID = $request.query.GDAPId
$GDAPID = $request.query.GDAPId ?? $request.Body.GDAPId

try {
$CheckActive = New-GraphGetRequest -NoAuthCheck $True -uri "https://graph.microsoft.com/beta/tenantRelationships/delegatedAdminRelationships/$($GDAPID)" -tenantid $env:TenantID
Expand All @@ -36,7 +33,7 @@ Function Invoke-ExecGDAPRemoveGArole {
$Message = "Relationship status is currently $($CheckActive.status), it is not possible to remove the Global Administrator role in this state."
}
if ('62e90394-69f5-4237-9190-012177145e10' -notin $CheckActive.accessDetails.unifiedRoles.roleDefinitionId) {
$Message = "This relationship does not contain the Global Administrator role."
$Message = 'This relationship does not contain the Global Administrator role.'
}
}
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function New-GraphGetRequest {
[string]$scope,
[bool]$AsApp,
[bool]$noPagination,
[bool]$NoAuthCheck,
$NoAuthCheck = $false,
[bool]$skipTokenCache,
$Caller,
[switch]$ComplexFilter,
Expand Down

0 comments on commit 12082a7

Please sign in to comment.