Closed davemfish closed 1 week ago
It looks like the necessary validation code is already there to perform this check. Might just need to find where we call check_directory
on the workspace and set permissions='rwx'
.
This seems to be a Windows-specific issue, since workspace permissions validation works as expected on macOS.
The cause appears to be a limitation of Python's os.access
method. From the docs:
Note: I/O operations may fail even when access() indicates that they would succeed, particularly for operations on network filesystems which may have permissions semantics beyond the usual POSIX permission-bit model.
A more reliable approach may well be to attempt the operation (e.g., write to the workspace directory) and throw an error if it fails, rather than try to determine in advance whether the operation is allowed.
I just tried this directory:
C:\\Program Files\\InVEST 3.14.1 Workbench\\runs
via the workbench. There was no validation warning, so this is what happened when I clicked run:This is especially important because a relative path entered in the Workbench UI will be relative to the installation path (
C:\\Program Files\\InVEST 3.14.1 Workbench\\
) where the user may not have write permission.