Skip to content

Commit

Permalink
[FIX] fs_storage: add missing sudo when creating FilsSystem
Browse files Browse the repository at this point in the history
This is necessary for non admin users to access file systems, for
instance for attachments.

This went unnoticed so far presumably because the filesystem is cached
and likely accessed by the server during server bootstrap.
  • Loading branch information
sbidoul committed Oct 5, 2024
1 parent 58afaf1 commit 732a34f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs_storage/models/fs_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def fs(self) -> fsspec.AbstractFileSystem:
"""Get the fsspec filesystem for this backend."""
self.ensure_one()
if not self.__fs:
self.__fs = self._get_filesystem()
self.__fs = self.sudo()._get_filesystem()
if not tools.config["test_enable"]:
# Check whether we need to invalidate FS cache or not.
# Use a marker file to limit the scope of the LS command for performance.
Expand Down

0 comments on commit 732a34f

Please sign in to comment.