Open preferences -> privacy and security -> privacy -> files and folders -> allow app to access the folders.

OR

x-apple.systempreferences:com.apple.preference.security?Privacy_DesktopFolder