file_manager: fix permission reporting

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-11-06 06:29:02 -05:00
parent 36536535bc
commit d490796da9
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 6 additions and 2 deletions

View File

@ -549,8 +549,12 @@ class FileManager:
(path.is_symlink() and path.is_file())
):
permissions = "r"
if self.check_reserved_path(real_path, permissions == "rw", False):
permissions = ""
for name, (res_path, can_read) in self.reserved_paths.items():
if (res_path == real_path or res_path in real_path.parents):
if not can_read:
permissions = ""
break
permissions = "r"
return {
'modified': fstat.st_mtime,
'size': fstat.st_size,