Skip to content

Commit

Permalink
Merge pull request maester365#538 from magnusjak/Added-support-for-'R…
Browse files Browse the repository at this point in the history
…oleManagement.ReadWrite.Directory'-privileged-role

Added support for 'RoleManagement.ReadWrite.Directory' as privileged …
  • Loading branch information
merill authored Dec 8, 2024
2 parents cd49783 + 9b5b321 commit 96739dc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion powershell/public/Get-MtRoleMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function Get-MtRoleMember {
if ($Active) {
$types += @{active = "roleManagement/directory/roleAssignments" }
}
if ($Eligible -and "RoleEligibilitySchedule.ReadWrite.Directory" -in $scopes) {
if ($Eligible -and ("RoleEligibilitySchedule.ReadWrite.Directory" -in $scopes -or "RoleManagement.ReadWrite.Directory" -in $scopes)) {
$types += @{eligible = "roleManagement/directory/roleEligibilityScheduleRequests" }
} elseif ($Eligible) {
Write-Warning "Skipping eligible roles as required Graph permission 'RoleEligibilitySchedule.ReadWrite.Directory' was not present."
Expand Down
2 changes: 1 addition & 1 deletion powershell/public/cis/Test-MtCisGlobalAdminCount.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function Test-MtCisGlobalAdminCount {
}

$scopes = (Get-MgContext).Scopes
$permissionMissing = "RoleEligibilitySchedule.ReadWrite.Directory" -notin $scopes
$permissionMissing = "RoleEligibilitySchedule.ReadWrite.Directory" -notin $scopes -and "RoleManagement.ReadWrite.Directory" -notin $scopes
if ($permissionMissing) {
Add-MtTestResultDetail -SkippedBecause Custom -SkippedCustomReason "Missing Scope RoleEligibilitySchedule.ReadWrite.Directory"
return $null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Test-MtCisaCloudGlobalAdmin {
}

$scopes = (Get-MgContext).Scopes
$permissionMissing = "RoleEligibilitySchedule.ReadWrite.Directory" -notin $scopes
$permissionMissing = "RoleEligibilitySchedule.ReadWrite.Directory" -notin $scopes -and "RoleManagement.ReadWrite.Directory" -notin $scopes
if($permissionMissing){
Add-MtTestResultDetail -SkippedBecause Custom -SkippedCustomReason "Missing Scope RoleEligibilitySchedule.ReadWrite.Directory"
return $null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Test-MtCisaGlobalAdminCount {
}

$scopes = (Get-MgContext).Scopes
$permissionMissing = "RoleEligibilitySchedule.ReadWrite.Directory" -notin $scopes
$permissionMissing = "RoleEligibilitySchedule.ReadWrite.Directory" -notin $scopes -and "RoleManagement.ReadWrite.Directory" -notin $scopes
if($permissionMissing){
Add-MtTestResultDetail -SkippedBecause Custom -SkippedCustomReason "Missing Scope RoleEligibilitySchedule.ReadWrite.Directory"
return $null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Test-MtCisaGlobalAdminRatio {
}

$scopes = (Get-MgContext).Scopes
$permissionMissing = "RoleEligibilitySchedule.ReadWrite.Directory" -notin $scopes
$permissionMissing = "RoleEligibilitySchedule.ReadWrite.Directory" -notin $scopes -and "RoleManagement.ReadWrite.Directory" -notin $scopes
if($permissionMissing){
Add-MtTestResultDetail -SkippedBecause Custom -SkippedCustomReason "Missing Scope RoleEligibilitySchedule.ReadWrite.Directory"
return $null
Expand Down

0 comments on commit 96739dc

Please sign in to comment.