Use getOwnerId API
As an application designer or story developer, you can use the getOwnerId API for getting the ID of the user creating the private version.
Getting the ID of the user who created the private version can check whether the version is owned by the current user. The check is necessary
because a user can't perform certain operations on a private version like deleting, copying or publishing if the user doesn't own it.
Note
This API can only be called on a private version and is therefore not relevant for BPC models.
Sample Code
// check if the private version is owned by the current user var privateVersion = Table_1.getPlanning().getPrivateVersion("privateVersionName"); if (privateVersion && privateVersion.getOwnerId() === Application.getUserInfo().id) { privateVersion.deleteVersion(); } else { // fallback. e.g. show message to user that they may not do certain operations on this version (delete, copy, publish) }