We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e300e4 commit b8c7320Copy full SHA for b8c7320
Modules/CIPPCore/Public/Authentication/Test-CIPPAccess.ps1
@@ -105,6 +105,18 @@ function Test-CIPPAccess {
105
#Write-Information ($User | ConvertTo-Json -Depth 5)
106
# Return user permissions
107
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
120
$Permissions = Get-CippAllowedPermissions -UserRoles $User.userRoles
121
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
122
StatusCode = [HttpStatusCode]::OK
0 commit comments