DropletPermissionsService
Checks and requests the macOS permissions behind a capability.
@MainActor protocol DropletPermissionsService : AnyObject
The host owns every TCC prompt: a droplet asks, Droppy prompts. That keeps the prompt attributed to Droppy, which is what the user granted, and it lets Droppy move the notch out of the way so the system alert is not drawn under the shelf that asked for it.
Ask for system-backed capabilities through here rather than through the framework that owns them directly. This includes microphone, speech-recognition, camera, contacts, calendars and reminders. A droplet runs inside Droppy, so macOS checks Droppy's Info.plist for the usage description, and a request against a host build that does not carry one ends the whole process. The host checks first and answers .unavailable instead.
Methods
openSystemSettings(for:)
@MainActor func openSystemSettings(for permission: DropletPermission)
Opens the relevant System Settings pane, for use after .denied.
request(_:)
@MainActor func request(_ permission: DropletPermission) async -> DropletPermissionStatus
Asks the host to request the permission. Returns the resulting status. Never call this at activation time; ask when the user reaches for the feature that needs it.
status(for:)
@MainActor func status(for permission: DropletPermission) -> DropletPermissionStatus
Current status for a capability that maps to a system permission.