-
-
Notifications
You must be signed in to change notification settings - Fork 158
Extend ResourceDefinition #477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@jaredcnance the one problem i'm facing at the moment is that there isnt a cache for all ResourceDefinitions. For this to work, we need to either register the ResourceDefinitions in the I'd say both; but I'd like to know your opinion on the matter on how to approach. I made a very basic example of what I would like to achieve with |
Ok, took a detour to get the ResourceDefinition problem on track, but currently encountering the TreeBuilding, any suggestions on how to tackle? This would alleviate a lot of trouble with deeply nested problems. We could then recursively go down the tree and apply any rules that the user has laying around. ALlowing for maximum flexibility |
We do not need a cache for |
How can I access them without injecting them all into the repository? I couldnt figure out how to grab all resourcedefinitions.. |
See my comment in the PR about |
Most correspondence about this done in #478 |
…ApiDotNetCore into feat/json-api-dotnet#477
…ApiDotNetCore into feat/json-api-dotnet#477
Merge branch 'feat/json-api-dotnet#477' of https://github.com/wisepotato/JsonApiDotNetCore into feat/json-api-dotnet#477
Resource hooks have been merged and released in v4.0.0-alpha3 |
Description
To allow for greater flexibility and reliability using filters we need to change a few things:
We need to change the dependency on
Include(string path)
inhttps://github.com/aspnet/EntityFrameworkCore/blob/473dafce1d2b2e2e2dfd49eb085b9c4bc220658a/src/EFCore/EntityFrameworkQueryableExtensions.cs#L2452-L2469
We then need to make sure that when we have the following cases:
and we have a
ResourceDefinition
on users, that on both urls the Users get filtered. An example of this would be a rule that the current user that is requesting the url cannot see user with an id of4
. Or that a user cannot patch a post with a certain type.This will require a change in
ResourceDefinition
and the implementation thereof in the Service and Repository layer.The repository will need to be changed:
JsonApiDotNetCore/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs
Lines 340 to 374 in e58a48d
Environment
The text was updated successfully, but these errors were encountered: