New-UDPage -Url "/Users" -Name "Users" -Content {
New-UDTypography -Text 'Roles assigned to this user:'
New-UDList -Content {
    $Roles | ForEach-Object{
        New-UDListItem -Label $_
    }
}


New-UDTypography -Text 'Variables this user can access:'
$AllPSUVariables = Get-PSUVariable
$TableData = $AllPSUVariables | Select *,@{n='RoleStr';e={$_.Role -join ", "}},@{n='SecretValue';e={$SecretValue=Get-Childitem ("Secret:" + $_.Name) -ErrorAction SilentlyContinue;If($SecretValue -is [string]){"secure_string"}Else{$SecretValue}}},@{n='SecretUsername';e={(Get-Childitem ("Secret:" + $_.Name) -ErrorAction SilentlyContinue).Username}}

New-UDTable -Columns @(
        New-UDTableColumn -Property 'Name' -Title 'Name' -ShowFilter
        New-UDTableColumn -Property 'RoleStr' -Title 'Role' -ShowFilter
        New-UDTableColumn -Property 'Type' -Title 'Type' -ShowFilter
        New-UDTableColumn -Property 'Value' -Title 'Value' -ShowFilter
        New-UDTableColumn -Property 'Secret' -Title 'Secret' -ShowFilter
        New-UDTableColumn -Property 'SecretValue' -Title 'SecretValue' -ShowFilter
        New-UDTableColumn -Property 'SecretUsername' -Title 'SecretUsername' -ShowFilter
    ) -Data $TableData -Dense
} -Title "Users" -Icon @{
		type = 'icon'
		id = '37c13667-6c5a-4cb1-a16b-49eaddd96d03'
	}