I'm implementing FileProviderExtension on macOS (NSFileProviderReplicatedExtension
) and one requirement I have to support is the support for locked files.
My requirement is that writing to locked files should be forbidden. Is there a way to support that in FileProviderExtension?
My approach was to report capabilities in FileProviderItem
like:
var capabilities: NSFileProviderItemCapabilities {
if locked {
return [.allowsReading, .allowsReparenting, .allowsDeleting]
}
return [.allowsReading, .allowsWriting, .allowsRenaming, .allowsReparenting, .allowsDeleting]
}
and indeed rename is forbidden (in Finder you cannot enter rename-state) but writing to file is allowed.
Is there a way to prevent writing to file in macOS FileProviderExtension?