Skip to content

Commit b8c7320

Browse files
committed
local dev fix part 2
1 parent 1e300e4 commit b8c7320

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,18 @@ function Test-CIPPAccess {
105105
#Write-Information ($User | ConvertTo-Json -Depth 5)
106106
# Return user permissions
107107
if ($Request.Params.CIPPEndpoint -eq 'me') {
108+
109+
if (!$User.userRoles) {
110+
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
111+
StatusCode = [HttpStatusCode]::OK
112+
Body = (
113+
@{
114+
'clientPrincipal' = $null
115+
'permissions' = @()
116+
} | ConvertTo-Json -Depth 5)
117+
})
118+
}
119+
108120
$Permissions = Get-CippAllowedPermissions -UserRoles $User.userRoles
109121
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
110122
StatusCode = [HttpStatusCode]::OK

0 commit comments

Comments
 (0)