Error during publishing (preflight and register) if the provided trait set is incompatible with managementPolicy or entityTraits (with kWrite access mode).
Add access mode to EntityInfo, for use in JSON DB queries. Default to ignoring access mode and returning the same data (from the entity "versions" list) for all access modes.
EDIT: "exceptions" was renamed to "overrideByTraitSet" and "overrideByAccess", see review comments.
Add new "exceptions" option alongside an entity "versions" list in the JSON database. The "exceptions" object is a mapping of (stringified) access mode to entity data, overriding lookup in the "versions" list.
In the new "exceptions" mapping, use the special value of null to mean the entity doesn't 'exist' for that access mode. Use the special value of empty dict {} to mean the entity exists but is inaccessible for that access mode.
With this mechanism in place, we can simulate read-only and write-only entities, and customise the returned trait sets for read and write access patterns, which then feeds into the aforementioned additional publishing validation.
Reviewer notes
CI is retargeted to use OpenAssetIO main. This is only necessary because the new convenience signatures for entityTraits are used in the tests. I'm happy to change this to use the callback-based signatures, so we don't have to target main, if desired.
Closes #90 #92.
Error during publishing (
preflight
andregister
) if the provided trait set is incompatible withmanagementPolicy
orentityTraits
(withkWrite
access mode).Add access mode to
EntityInfo
, for use in JSON DB queries. Default to ignoring access mode and returning the same data (from the entity"versions"
list) for all access modes.EDIT:
"exceptions"
was renamed to"overrideByTraitSet"
and"overrideByAccess"
, see review comments.Add new
"exceptions"
option alongside an entity"versions"
list in the JSON database. The"exceptions"
object is a mapping of (stringified) access mode to entity data, overriding lookup in the"versions"
list.In the new
"exceptions"
mapping, use the special value ofnull
to mean the entity doesn't 'exist' for that access mode. Use the special value of empty dict{}
to mean the entity exists but is inaccessible for that access mode.With this mechanism in place, we can simulate read-only and write-only entities, and customise the returned trait sets for read and write access patterns, which then feeds into the aforementioned additional publishing validation.
Reviewer notes
CI is retargeted to use OpenAssetIO
main
. This is only necessary because the new convenience signatures forentityTraits
are used in the tests. I'm happy to change this to use the callback-based signatures, so we don't have to targetmain
, if desired.