natcap / invest

InVEST®: models that map and value the goods and services from nature that sustain and fulfill human life.
Apache License 2.0
170 stars 70 forks source link

Updates directory permissions validation to use an EAFP approach #1620

Closed emilyanndavis closed 2 months ago

emilyanndavis commented 2 months ago

Description

Should fix #1599 by shifting to an EAFP approach to validating directory access.

File permissions validation still relies on os.access(), for now.

Checklist

macOS screenshots

Tested the Workbench UI on macOS with the following eight user permissions scenarios (some more likely to exist IRL than others): ---, r--, -w-, --x, rw-, r-x, -wx, rwx. Here are just a few examples:

No access (missing r, w, and x)

workspace-permissions_no-access_2024-08-27

Strictly readonly (has r, missing w and x)

permissions_r_2024-08-27

"Readonly" in the colloquial sense (has r and x, missing w)

permissions_rx_2024-08-27

Full access (has r, w, and x)

permissions_rwx_2024-08-27