Welcome to the forums !
It is indeed possible.
You can filter who can view which pages by using the -AuthorizationPolicy and -AuthorizedRole on your pages.
Here’s an example with Oauth (Azure in this case) group filtering applied.
If you want to filter out whole pages, when defining your dashboard, you would do something like this :
$AuthorizationPolicy = New-UDAuthorizationPolicy -Name "SuperAdmin" -Endpoint {
param($User)
$User.HasClaim("groups", "02934b66-10a9-420a-1110-a01923045")
}
Then, you’d apply them to your dashboard upon creation.
$MyLogin = New-UDLoginPage ... -AuthorizationPolicy $AuthorizationPolicy ...
New-UDDashboard -LoginPage $MyLogin ...
To filter UDPage out to some users only, you would then create your new-udpage the New-UDPage -AuthorizationPolicy ‘SuperAdmin’ parameter (SuperAdmin correspond to the choosen name and apply the custom condition, in this case, based on a Azure group membership claim, to your dashboard.
I’ll leave at the bottom a link to a “claims viewer” page that can help view the claim of the connected user to create those.
The other filtering you can perform is in the UDPage itself.
You can do something like :
$IsInSuperAdminGroup = $ClaimsPrinciple.claims.value.contains('16cca29e-f53e-4260-8181-74b11f2b70b1')
if ($IsInSuperAdminGroup) {
New-UDCard -Title 'Hey you' -Text 'You are a super admin !'
}
In this instance, the ud card would be shown only to users matching the specified claim (group membership or role) criteria.
Some documentation on the subject.
https://docs.universaldashboard.io/security/authorization/claims-based
https://docs.universaldashboard.io/how-to/get-the-user-email-address-when-using-oauth
A helper page I made that displays the claims
Edit:
Regarding filtering within a page, I also found the following dedicated method :
$Policies = Get-UDAuthorizationPolicy
if ($Policies -contains 'Administrator') {
New-UDCard -Title 'Administrator' -Content {}
}
It is even better than the first method I proposed altough on my end, I have an error message when I use it which might or might not be a bug in 2.5. Neverthless, both methods are valid ways to filter your page.