Skip to content

Commit

Permalink
Merge pull request #5403 from NikCharlebois/Fixes-for-Schedule
Browse files Browse the repository at this point in the history
AADRoleEligibilitySchedule
  • Loading branch information
NikCharlebois authored Nov 14, 2024
2 parents a6530b9 + 16e2fce commit 9f31506
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

# UNRELEASED

* AADRoleEligibilityScheduleRequest
* Adds support for custom role assignments at app scope.

# 1.24.1113.1

* AADConditionalAccessPolicy
* Fixed bug where an empty value was passed in the request for the
insiderRiskLevels parameter, which throws an error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,20 @@
return $nullResult
}
$RoleDefinitionId = (Get-MgBetaRoleManagementDirectoryRoleDefinition -Filter "DisplayName eq '$RoleDefinition'").Id
$schedule = Get-MgBetaRoleManagementDirectoryRoleEligibilitySchedule -Filter "PrincipalId eq '$($request.PrincipalId)' and RoleDefinitionId eq '$RoleDefinitionId'"
$schedules = Get-MgBetaRoleManagementDirectoryRoleEligibilitySchedule -Filter "PrincipalId eq '$($request.PrincipalId)'"
$schedule = $schedules | Where-Object -FilterScript {$_.RoleDefinitionId -eq $RoleDefinitionId}
if ($null -eq $schedule)
{
foreach ($instance in $schedules)
{
$roleDefinitionInfo = Get-MgBetaRoleManagementDirectoryRoleDefinition -UnifiedRoleDefinitionId $instance.RoleDefinitionId
if ($null -ne $roleDefinitionInfo -and $RoleDefinitionInfo.DisplayName -eq $RoleDefinition)
{
$schedule = $instance
break
}
}
}
}
if ($null -eq $schedule -or $null -eq $request)
{
Expand Down

0 comments on commit 9f31506

Please sign in to comment.