Allow "unresolvable conflict" errors to be circumvented using initialNamespaces
#102950
Labels
enhancement
New value added to drive a business result
Feature:Saved Objects
Feature:Security/Sharing Saved Objects
Platform Security - Sharing Saved Objects feature
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Team:Security
Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Blocked by: #102957
In #101904 (PR: #102585), we added support for
initialNamespaces
to be used when creating isolated object types. This allows consumers to create any non-space-agnostic object and define the initial space(s) it should be created in. It breaks down the barriers between spaces in the SavedObjectsRepository (SOR) and SavedObjectsClient (SOC), where operations are otherwise generally isolated to a single space.However, multi-namespace objects currently have a limitation because they have globally unique IDs: if you try to create an object in space A, but an object with the same ID already exists in space B, that operation will fail with an "unresolvable conflict" error. This makes sense for a normal create operation, but the assumption breaks down when using the
initialNamespaces
option.When creating an object and using the
initialNamespaces
option in conjunction withoverwrite: true
, the consumer is being deliberate about what they want to accomplish, and we should allow them to overwrite the existing object without throwing an unresolvable conflict error. However, we should only allow this if the user has privileges to do all of the following:initialNamespaces
)To enable this behavior, we have to do two things:
create
andbulkCreate
to see if the object currently exists, and if so, what space(s) it exists ininitialNamespaces
andoverwrite: true
are both specifiedThe text was updated successfully, but these errors were encountered: