[Create] Always allow cloning self

Always allow cloning the newly-created object itself
when saving a newly-created domain object.
This commit is contained in:
Victor Woeltjen 2016-02-10 13:49:15 -08:00
parent 3146660833
commit 0bdf05e61c

View File

@ -106,12 +106,13 @@ define(
return fetchObject(object.getModel().location);
}
function isOriginal(domainObject) {
return domainObject.getCapability('location').isOriginal();
function allowClone(objectToClone) {
return (objectToClone.getId() === domainObject.getId()) ||
objectToClone.getCapability('location').isOriginal();
}
function cloneIntoParent(parent) {
return copyService.perform(domainObject, parent, isOriginal);
return copyService.perform(domainObject, parent, allowClone);
}
function cancelEditingAfterClone(clonedObject) {