Go to System Settings → Privacy & Security→ Full Disk Access.
on macOS 13
on macOS 12 and earlier
Note: If the version of the operating system is lower than macOS 13, to unlock the panel settings you need to click the “Lock” icon in the lower-left corner and enter your system password.