If I don't include the allowsReparenting
capability in FileProviderItem capabilities list, the system allows to move the folder to another parent.
Example of my capabilities list:
var capabilities: NSFileProviderItemCapabilities {
[.allowsReading, .allowsWriting, .allowsRenaming, .allowsDeleting]
}
Expected: when I move the item (ie Folder) in Finder to another location, Finder should present an error that move is not allowed.
Actual: even though I didn't include allowsReparenting
capability, system still allows to move the item in Finder.
Did anyone encounter similar issue. I guess I'll submit a bug report to Apple, but maybe I'm missing something here?
The behaviour probably is correct, if you look at the headers/developer docs for .allowsWriting
:
/**
Indicates that the file can be opened for writing. If set on a folder,
this is equivalent to @c .allowsAddingSubItems.
*/
public static var allowsWriting: NSFileProviderItemCapabilities { get }
/**
Indicates that items can be imported to the folder. If set on a file,
this is equivalent to @c .allowsWriting.
*/
public static var allowsAddingSubItems: NSFileProviderItemCapabilities { get }
/** Indicates that the item can be moved to another folder */
public static var allowsReparenting: NSFileProviderItemCapabilities { get }
.allowsAddingSubItems/.allowsWriting
is the one that defines if you can create a new folder, upload a file to an existing folder, etc if I am correct.