In macOS/Windows, there are runtime permissions these days which allow you to control which folders can be given to which application.
Linux needs to mainstream a solution like this. One of the most popular way Linux users can handle this today is by associating a user with a application and granting various permissions to that user. However this is a far cry from safe by default, and it requires deep system knowledge.