My application requires access to the Documents folder. As a result, the first time you launch the app, you get the privacy dialog that prompts you to give the application access to the Documents folder. If you hit OK, the checkbox appears enabled in privacy preferences.
However, if I then uncheck that box and launch my app again, it gets killed right away. The system logs show access is denied for kTCCServiceSystemPolicyDocumentsFolder. This feels unexpected to me, because if the checkbox for Documents folder isn’t checked, shouldn’t things revert back to the original behavior, where the user is prompted for access?
To summarize:
Expected behavior: Disabling access to Documents folder in privacy preferences and then launching the app should result in the privacy dialog appearing to request access from the user
Actual behavior: Disabling access to Documents folder in privacy preferences and then launching the app causes a SIGKILL to get sent to the app, so the app fails to launch without any user-facing error messages. In addition, if I remove all entries for the app in “Files and Folders” and “Full Disk Access” (in an attempt to revert back to the original prompting behavior), the same issue occurs.
Is the behavior I am seeing by design? I realize I can manually reset the TCC database but would like to know if the behavior I am seeing is intentional or not.