Post

Replies

Boosts

Views

Activity

Reply to Writing to /Library/Application Support
Thank you for your response. The data we’re looking to share is application-specific configuration data that all users logged into the computer may need to access and read. The intent is for this data to be available to any user of the application across user sessions on the same device, without requiring duplication per-user. However, the data should remain protected from external modification by users who are not using our application (i.e., it should only be modified by our app). We understand that LocalDomainMask can be used to create a directory in a location accessible to all users. However, this data is sensitive to the application’s functionality, so we’re looking for a secure and centralized storage location that enforces protections similar to those within a user’s Library directory but accessible by multiple users. Is there a recommended entitlement or alternative approach for securely sharing such application-specific data between all users of a single computer? Thank you for any insights into a modern, macOS-supported approach for this use case.
3w
Reply to Writing to /Library/Application Support
Thank you, Quinn, for following up on my question. You asked, "What sort of information are you trying to share?" I provided details on why we need access to a generally accessible location to support our use case. However, we still don’t have a concrete answer to our initial question about making this code work. While we understand the restrictions surrounding file access privileges, our goal is to implement a reliable solution within the constraints provided. Here's the code we're currently using: do { let baseDir = try fileMgr.url(for: .applicationSupportDirectory, in: .localDomainMask, appropriateFor: nil, create: true).appendingPathComponent("com.MyCompany.AppName", conformingTo: .directory) try fileMgr.createDirectory(at: baseDir, withIntermediateDirectories: true, attributes: nil) } catch { Swift.print("ERROR: can't create baseDir \(baseDir)") exit(0) } This code returns the error: "You don't have permission." Could you please clarify what steps we need to take to request or configure the necessary permissions to access this directory? We appreciate your thoughts on security and how to restrict access. The challenges we can deal with in our app. We just need access to that directory. Thank you for any insights you can provide to help us move forward.
1w