C#C
C#4y ago
Gopher

ASP MinimalAPI Autzhorization

Hey, I would like to know how to create permissions dynamically.
I know how to use things like Roles and the Authorized Keyword so far.
But in my case, i want to enable deleting/updating entries only to people who created those / or which are related to these entries.
For example i have a m:n relation between users and entityA.
Right now i have a prop in the "in-between-table" that defines the relation between those.
If somebody wants to change the entity, i take the userId in the endpoint and check in a linq querry if the relationship allows that.
But this approach seems a bit weird since its in a completely different location than the authorization system of ms-identity and identity-server
do those have a feature i could use to make authorization in a better way?
Was this page helpful?