validate the "publicKey" property of entity is not duplicated when creating new entity
bjrmatos opened this issue · 1 comments
we should validate that the property that is marked as publicKey: true
in definition of entity (almost in all cases is the property name
) does not end duplicated in the store.
i think we can do this by using a .beforeInsert
listener that is added at .initializeListeners
stage, i think that order is important in order to let other logic with more higher priority (like the one in jo) to be able to run first.
we should also review if the extensions are using publicKey: true
where it is expected, and what other extensions are not using it at all (like UserType
in jsreport-authentication that is not using it)
this was done as part of the folders support, "publicKey" are now validated according to folder level, which means that entity name is unique per folder level, entity name can be duplicated only if the entities belongs to different folder levels