Skip to content

Compose policy providers #1

Description

@dazinator

I stumbled accross this project, I've written permission based authorization already in asp.net core apps so I was curious to check out this implementation!

One issue I noticed is here:

https://github.com/iammukeshm/PermissionManagement.MVC/blob/master/PermissionManagement.MVC/Permission/PermissionPolicyProvider.cs#L17

Assuming the fallback provider is the Default doesn't allow for composition when you have multiple custom providers.
For example suppose I implement another PermissionPolicyProvider called AmazingPolicyProvider and distribute this in a nuget package, and it adopts exactly the same pattern as this PermissionPolicyProvider. An application can now either use your PermissionPolicyProvider OR my AmazingPolicyProvider but not both together - yet it can only provide one to the MVC application.

To solve this you basically need write the PermissionPolicyProvider so that it supports composition.

You can see my take on that here: https://github.com/dazinator/Dazinator.AspNetCore.Authorization#note-to-provider-authors

Probably not a massive priority for your project but thought I'd mention it just in case :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions