Protect object loading
Ensure an object belongs to the current Organization after it is fetched from the database.
We will have different types of checks with different performance profiles:
- Objects sharded by
organization_id - These results will have objects with an
organizationthat should be comparable against theCurrent.organization. These will be fast. - Objects sharded by
namespacesandprojects - These could require a database query to resolve the Organization associated with the Namespace or Project. Systematic secondary queries may not be an acceptable solution? (Or maybe they are)
- Unsharded objects
- No filtering needed.
This relates to #548429
Edited by Alex Pooley