How can we access and add applications under Full Disk access pane programatically

With new security and permission related checks including in Mojave and Catalina. In my swift application I am trying to create a copy of file using below function

“open func copyItem(at srcURL: URL, to dstURL: URL) throws”

As I call this function , my application entry is created under Full Disk Access panel of Security & Privacy in System Preferences. Unless until I enable this I can’t create a copy of my file using the function I mentioned above.






My issue: This entry getting added to the Full Disk Access is happening silently, I dont see any security alert asking me to allow or dont allow. We dont even have any API to get this information , so that we can ask user to manually add it.


Where can I get appropriate documentation about Full Disk access feature which will help to understand which locations are restricted to access and how can I enable it programtically without users interference

Replies

How can we access and add applications under Full Disk Access pane programatically

There is no API to get or set the Full Disk Access list in System Preferences. While it’s impossible to predict the future with 100% accuracy, my best guess is that Apple will not add an API to modify this list; these settings are deliberately meant to be under the control of the user.

Reading this list, or getting your own app’s status, is a slightly different story. The best way forward depends on your specific requirements. You wrote:

In my swift application I am trying to create a copy of file using …

What file are you trying to copy?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi eskimo

I have same issue with SyamalaDutt.

Because Use select "Don't Allow" on security alert while app need to access to file. Then file will broken or corrupted

So My app need to get status that whether use have to enable Full Disk Access\Files and Folders or not?


Also, I'm try disable Full Disk Access for my app, but security alert don't again show.

I think that security alert have some problem. it is too bad