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 need to use my own layout component on a page, derived from LayoutComponentBase, to perform access checks. The idea was to create something similar to the Authorize attribute, but one that accepts my context and required permissions, and the check itself would simply call my SecurityManager.HasAccess. If access is denied, it would render an AccessDenied component; otherwise, it would render the Body.
The problem is that the page already uses a specific layout responsible for the overall page structure, and I cannot remove it. Because of that, I cannot apply my own layout through layout attribute. The way with inheritance also doesn't work. Moreover, the option using a separate wrapper component is not a very beautiful option.
Question:
What is the correct way to implement this kind of access check when the page already uses a layout?
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.
-
I need to use my own layout component on a page, derived from LayoutComponentBase, to perform access checks. The idea was to create something similar to the Authorize attribute, but one that accepts my context and required permissions, and the check itself would simply call my SecurityManager.HasAccess. If access is denied, it would render an AccessDenied component; otherwise, it would render the Body.
The problem is that the page already uses a specific layout responsible for the overall page structure, and I cannot remove it. Because of that, I cannot apply my own layout through layout attribute. The way with inheritance also doesn't work. Moreover, the option using a separate wrapper component is not a very beautiful option.
Question:
What is the correct way to implement this kind of access check when the page already uses a layout?
Beta Was this translation helpful? Give feedback.
All reactions