Skip to content

Blazor component AuthorizeView can accept the AuthorizationPolicy combine function result. #52920

@deadislove

Description

@deadislove

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I tried to use the AuthorizationPolicy.Combine function combining two or more policies to a new policy, then assigning to the AuthorizeView. I found that Blazor's AuthorizeView component does not support the AuthorizationPolicy.Combine function result. I hope it can work in the future. It can be used in more situations when the policies are complex or have complex condition situations.

Describe the solution you'd like

I want to solve the AuthorizeView, which has complex policies and roles, but every policy is independent. The role part is also independent. Some situations will be an A + B policy, so I must create a new policy for these combined results and then assign it to the AuthorizeView component. Let it approach the clean code and be easy to read.

My solution is to use the AutorizeView component nested policy. This policy graph is like the tree graph. When the user action navigates to another page, the authorization handler event will check the user permission data info. This solution has no benefit viewpoint. When the page nest is much bigger, the authorization handler event will delay the page render event and dom event happening time.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issueStatus: No Recent Activityarea-blazorIncludes: Blazor, Razor Componentsinvestigate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions