How to disable the duplicate option in FileProvider

I'm writing an NSFileProviderExtension for an App. In this extension the user doesn't necessarily have unrestricted access to all of the files. In the FileProvider extension I translate the permissions the user has into NSFileProviderItemCapabilities. This works like a charm for almost all use cases, except when the user has no create permission on a folder. When this happens, the folder doesn't have the capability NSFileProviderItemCapabilities.allowsAddingSubItems (it also doesn't have NSFileProviderItemCapabilities.allowsWriting). As a result the "duplicate" option should be disabled for all children of said folder, however in practice this isn't the case. The option is still enabled and when executed will go into the importDocument(at: toParentItemIdentifier: completionHandler:).

To confirm that the capabilities are configured properly i also added a guard statement at the beginning of the method.

@available(iOS 11, *)
    override func importDocument(at fileURL: URL,
                                 toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier,
                                 completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
        guard try! self.item(for: parentItemIdentifier).capabilities?.contains(.allowsAddingSubItems) ?? false else {
            let customError = self.createCustomError(errorString: NSLocalizedString("ErrorNoCreatePermissions", comment: ""))
            completionHandler(nil, customError)
            return
        }


And it actually throws this error in the described scenario, even though the documentation states: "The user's ability to import an item into a directory is controlled by the parent directory's

allowsAddingSubItems
capability."(https://developer.apple.com/documentation/fileprovider/nsfileproviderextension/2882093-importdocument)


So the question boils down to: How can I disable the "Duplicate" option in the FileProvider extension?