From b55b21921afcde77cf8bccb58753e46fe93f5142 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sat, 30 Oct 2021 16:49:41 -0400 Subject: [PATCH] file_manager: report additional info in response to get_directory Include the root's name and its permissions. Signed-off-by: Eric Callahan --- moonraker/components/file_manager/file_manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/moonraker/components/file_manager/file_manager.py b/moonraker/components/file_manager/file_manager.py index 1a0c016..06e7f21 100644 --- a/moonraker/components/file_manager/file_manager.py +++ b/moonraker/components/file_manager/file_manager.py @@ -405,6 +405,10 @@ class FileManager: flist['files'].append(path_info) usage = shutil.disk_usage(path) flist['disk_usage'] = usage._asdict() + flist['root_info'] = { + 'name': root, + 'permissions': "rw" if root in self.full_access_roots else "r" + } return flist def get_path_info(self, path: str, root: str) -> Dict[str, Any]: