问题
Applications which require Full Disk Access in macOS 10.14 Mojave must instruct their users to navigate into System Preferences > Security & Privacy > Full Disk Access and add the application to the whitelist. This procedure is complicated and will frustrate new users of such an app.
There should be a API for this – an asynchronous function which, when called by an app, would present the user with a dialog requesting Full Disk Access and, if the user clicks OK, automatically enter the calling app into the Full Disk Access whitelist. This function should pass the user's YES or NO to its completion handler. There should be another function which would indicate an app's Full Disk Access status.
It appears that Apple has added API to check for AppleEvent authorization. Have they added something similar for Full disk access? If yes, please redirect me to that API.
回答1:
There is no API that prompts the user to enable Full Disk Access.
New in Catalina, if an app attempts to access files that require Full Disk Access, that app will be added, unchecked, to the Full Disk Access table view.
So, now in macOS Catalina, executables that are denied access to files due to a lack of Full Disk Access approval are now prepopulated unchecked.
https://asciiwwdc.com/2019/sessions/701
That at least makes it a bit easier to direct users to enable Full Disk Access for an app.
来源:https://stackoverflow.com/questions/57974020/is-there-any-api-to-get-full-disk-access-info-for-an-application-in-macos