You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to check if the current user has access rights to a specific page (Blazor component) in my Blazor application based on the page URL (or Type of Page for that matter).
Is there an existing framework feature or a recommended pattern to handle this scenario or should I implement my custom logic for matching URLs to Page types and then extract the page policy using reflection from the attributes?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What I aim to achieve:
I want to check if the current user has access rights to a specific page (Blazor component) in my Blazor application based on the page URL (or Type of Page for that matter).
Ideally, I'd like to do something like this:
Is there an existing framework feature or a recommended pattern to handle this scenario or should I implement my custom logic for matching URLs to Page types and then extract the page policy using reflection from the attributes?
My Blazor Page (Component) example:
Could you please advise if there's an existing method to achieve this within ASP.NET Core, or I will need to develop a custom solution?
Beta Was this translation helpful? Give feedback.
All reactions