Files
David Dreschner 2f258eef37 fix(quota): Calculate used quota for foreign users the correct way
When the `quota_include_external_storage` setting is enabled and a shared folder is mounted, the free space is being calculcated the wrong way.

Example:
- user1 has a quota of 10GB with 9GB used
- user2 has a quota of 5GB and shares a folder with user1
- user1 tries to write a file to the shared folder
- Upload fails due to `quota-available-bytes: 0` (the usage of 9GB being compared against the 5GB of user2)

The issue is fixed by checking the usage of the folder's owner instead of the session user's. The same issue also applies to the admin overview, where the admin's own quota is being shown for users whose files folder is an external storage mounted at `/`.

Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
2026-11-04 19:30:19 +01:00
..
2026-10-27 13:07:23 +01:00