-
-
Notifications
You must be signed in to change notification settings - Fork 158
Question on authorization #1001
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
I would say the answer is no. For the first mechanism, you're checking permissions on resource instances. This affects data going through the layers of the JADNC pipeline, thus requires FilterExpressions to avoid tight coupling with EF Core. Depending on security requirements, you may not want to differentiate between 'not found' and 'exists, but access denied'. But I'm assuming you do want to differentiate. So to implement 2:403, you can catch We intentionally provide no way to remove resources from the to-be-returned set afterwards, because it promotes bad design that does not scale. Its better to filter out what is unneeded using a WHERE clause, over fetching too much, then filtering in-memory. Another problem is paging: when filtering out elements before returning them, the paging is no longer correct: current page number and total number of pages is wrong and a non-last page contains less elements than the page size. |
@bart-degreed, thanks for the quick answer. There might be a misunderstanding regarding the second mechanism (using Linq expressions to check write access permissions). For example, consider a system that has Regarding the differentiation in the case of read access, I currently return 403 Forbidden if the user does not have permission to access any I understand your point on "removing resources from the to-be-returned set afterward." So it has to be two mechanisms. Now, from your point of view, would it be better to add the write access control part to the resource definition as well once you've added the write callbacks? Or should this remain in the controller? If your recommendation were to add this to the resource definition, what would be the best way to deny write (post, patch, delete) access? Throw a P.S.: By the way, I have spent some time in The Hague and also Rijswijk. |
@bart-degreed, you should change the title of the issue into "Question on authorization" or "Question on access control". It is not related to authentication, which happens before. |
Probably and yes. Probably because a controller executes earlier, so you can bail out quickly. If you're doing data access anyway to assert access, this advantage does not make much difference. The engagement/party scenario you're describing sounds similar to multi-tenancy, we have an example for that, in case it helps. Its all in the details, I don't think there is a right way. Just experiment and see what happens, I think you're on the right track. I studied at Rijswijk, but the institution was later merged with The Hague. |
See #977 (comment)
The text was updated successfully, but these errors were encountered: