This is a very minor thing, but as there was previously an issue with multiple roles being specified in the New-UDPage -Role parameter and so we’d implemented our own check within the page using $Roles which displayed a custom message if the person attempting to access the page doesn’t have the required role, such as:
We’re looking at switching back to using the -Role parameter in New-UDPage so that pages a user doesn’t have access to aren’t displayed in the navigation bar, but I’m wondering if it’s feasible to add a -OnAccessDenial parameter to New-UDPage to allow for custom error display should the user access the direct link, e.g. if provided that link by another user who has access?
This would allow me to tell a user three things over the generic “Page Not Found” error displayed currently when someone without the required role tries to get in:
- The page exists.
- You don’t have access.
- Here’s the roles that do have access if you need to request one.
Product: PowerShell Universal Version: 2.7.4