First off, ruling an issue out here:
However, when our tool is installed from a Standard Account, the macOS messages asking for confirmation to access the Desktop or Documents or Downloads folder don’t appear and access to the file/folders is denied.
Does your app include all of the relevant tcc strings (NSDesktopFolderUsageDescription, etc.)? Also, one thing to be careful of here is that there are a bunch of heuristics in this system that control how/when these are presented, which can make knowing "why" something is working a particular way difficult to determine. When you're looking closely at an issue like this, I'd always suggest working on a totally "clean" machine*, not your normal development machine.
*VMs are handy for this, as you can get the system to a fully configured state, then duplicate the VM image so you can always start over from the same exact starting point.
We install a Photoshop plug-in and it’s mainly a UI which then executes a background app containing the business logic to read/write files. The background app runs as a separate process and is not in the Photoshop sandbox space so it doesn't inherit Photoshop permissions/scoping rules.
Full disclosure, I have no idea how Photoshop's plugin system works these days. Is your Photoshop plugin written as a library that Photoshop loads and executes or is it an independent process/app that Photoshop runs?
Getting into details:
executes a background app containing the business logic to read/write files.
How are you doing this? Is the background app a launch agent or something else? Also, what exactly "is" your background app? Is it a true (presumably faceless) "app" that runs NSApplication, has a bundle ID, etc.?
Our plug-in communicates with the background process via ports etc.
How are you actually communicating? XPC or something else? The "official" way to transfer file access is what's described in "Share file access between processes with URL bookmarks”. However, while I know that will work over XPC, I'm not sure it will work through other communication pipes. Note that if you use this approach, make sure you read it carefully and don't pass anything into the options parameter. Somewhat confusingly, you DON'T want to create a "security-scoped bookmark", because that would actually restrict access (details depending on the bookmark type). What you're creating has implicit scope attached, which means the access of the creating process is extended to the receiving process.
There are other options for transferring access, but I want to understand what you're actually doing in more depth before we get into that.
Finally, on this point:
Should we try to register these as Full Disk Access?
I would recommend against this. It's a lot more access than you really want, there isn't any way to "know" if it's on or not, and the confusion around that makes it very difficult to know why something actually failed. Ultimately, that means you end up with a narrower "I can't access these files and I don't know why" problem, which is exactly where you started.
Does anybody have any idea how to allow for the file/folder permissions to be registered/granted in such a case?
SO, my big recommendation here is that you START by doing the interface work of:
-
Create UI that tells the user that you can't open the file/object and asks them to give you access through an open panel.
-
(optional) Create UI that allows the user to select directories you "should" have access to, which your background app then saves access to using bookmarks.
The idea here is that this is the "final defense" that ensures your app ALWAYS works. This final defense is important because:
-
macOS is sufficiently complicated that it's difficult to cover EVERY single possible case. The UI above means that missing an edge case doesn't break your app.
-
End user configurations are EXTREMELY difficult to predict or control. This is actually what makes #2 helpful- it lets people with unexpected/odd configurations fix any issue "themselves" without you needing to be involved.
-
Even if something works today, it's very hard to guarantee it will work in the future, either because the system changes or we introduce bugs. Note that the benefit of the open panel isn't that it's immune from bugs*, it's that it's SO critical that it's a pretty safe bet that we'll make fixing it a top priority.
*Over a long enough time scale, everything breaks.
That last point is really critical here. I'm sure we can figure out and fix whatever is happening here. I'm also fairly sure that this will happen again in some other context no matter what you do. Forcing the user to manually select files they "shouldn't" have to is annoying, but that's still better than failing without any solution.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware