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 authored and qgroulard committed Oct 7, 2024
1 parent 7e1da09 commit f670bc6
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 f670bc6

Please sign in to comment.