+47
−8
+256
−1
+6
−1
Loading
XLSX downloads previously authorized only the requested collection, exposing unreadable descendant collections, resources, and their metadata values. Pass the request's shared UserAccess instance into export generation and check each collection and unique resource independently. Preserve explicit read grants inside denied branches, existing row ordering, multiple metadata values, and repeated resource memberships. Return HTTP 403 for a denied export root. Reuse the loaded subtree and root ancestors for collection checks, prefetch resource ACL ancestry in batches, and fetch metadata values only for authorized rows. Query counts remain unchanged when growing from 1 to 21 descendant collections and resources at the same depth, with global or scoped permissions. Keep trusted internal exports without an ACL compatible. Document the TYPE_CHECKING import that avoids the models/ACL circular dependency. Add regression tests for denied rows and metadata, explicit and inherited grants, memberships outside the subtree, project boundaries, export ordering, and query scaling. Validation: all 192 resources, rpc, and annotations tests passed; Ruff and git diff --check passed.