This is something that trips a lot of people up. In particular, end users are confused by it. Many of them have heard about Full Disk Access, so they will attempt to give it to your app, but it won't work, because of the sandbox. They don't know about that. And if you are distributing in the Mac App Store, you can't tell them either. 🙂 If you are planning on Mac App Store distribution, your app has to be fully functional without any kind of sandbox escape or Full Disk Access. You can't even show a button unless the user goes looking for it on purpose.
But generally speaking, there are two steps to accomplish. I call it "Full Drive Access" to differentiate it, and because there ain't no disks no more.
1) You will need to use an NSOpenPanel to get a reference to the root folder of the drive. You can specify the root folder and force the dialog into the correct location. And then you can check the result and make sure you really got root back. Save that as a Security-scoped bookmark and now you've escaped the sandbox. But you're not done....
2) On Mojave an later, you still need to get Full Disk Access in system preferences. You can use a handy deep link for this (x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles) to make the process slightly less painful. But you'll still need to quit the app.
So, you will have to start the process inside your app to get both parts on 10.14+. If you are running on 10.13, you only need the first part.
Another complication is that the security database can get confused. You might need to relaunch your app a couple of times. You might need to restart. Unfortunately, the machines that developers use can get these internal databases quite scrambled. I strongly recommend a VM system for Mac development. They are easy to setup and rollback. They aren't good for graphics. If you need decent graphics, you'll have to use a separate machine with liberal use of APFS snapshots for rolling back.
I use Parallels Desktop Lite just because it doesn't have host kernel extensions. (I can't recomend that product without complaining about their dirty little trick to use a minor App Store upgrade to slide in a paid subscription. I would paid for a supported and upgraded Mac App Store app and there are established, honest means of doing that. They used a tricky and sneaky method instead. I would use a different VM if I could find another one that didn't require host kernel extensions.)
In all honesty, this is not a viable, long-term solution. Customers who've already paid are invested and can be coaxed into giving privileges. It won't fly for new customers.
For your application, I suggest getting comfortable with NSTemporaryDirectory(). That will work regardless. Then get comfortable with NSOpen/Save panels and security-scoped bookmarks. You should be able to accomplish what you describe with a minimum amount of user confusion and hassle. Remember, there are some things that you will find horribly tedious because you test the app so much. Users run your app less frequently, so these daily inconveniences won't bother them as much. A big barrier like Full Disk Access with sandbox escape is going to keep them from ever being customers in the first place.