Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addons: small improvements and privacy considerations (#11561)
- We had a special case in a permissions class, I moved this into the view itself. - We are allowing some requests to not have a version, so our normal permission check doesn't work in this case. In case that we don't have a version, we just check for the project permission. - If we have a version, we are attaching its latest build, this code was duplicated, and wasn't taking into considerations permissions. In case of temporal sharing tokens, they don't have access to builds. - Translations now take into consideration the current user permissions - The list of active versions can now be overridden from .com to include versions granted by a temporal access. Some notes: - We are returning some custom 404 responses, but DRF already handles that when using get_object_or_404. Anyway, users won't see any of the messages, since our 404 handler is catching those in production. - Returning the full serialized version of translations takes like 40 extra queries, probably it generates more per extra translation. From what I found, most of the queries are due to the serializer returning more related projects fully serialized (main translation, superproject). - We are allowing users to override the whole response, we should just allow to override the `addons` key. - This also suffers from readthedocs/readthedocs-corporate#1845 Since to really run the whole code from permissions checks organizations are needed, I'll add tests on .com. ref readthedocs/readthedocs-corporate#1773
- Loading branch information