} catch (EMFUserError e) {
logger.error("Error while istantiating DAO", e);
throw new SpagoBIServiceException(SERVICE_NAME, "Cannot access database", e);
}
SubObject subObject = null;
try {
subObject = dao.getSubObject(subObjectId);
} catch (EMFUserError e) {
logger.error("SubObject with id = " + subObjectId + " not found", e);
throw new SpagoBIServiceException(SERVICE_NAME, "Customized view not found", e);
}
BIObject obj = executionInstance.getBIObject();
if (obj.getId().equals(subObject.getBiobjId())) {
boolean canExecuteSubObject = false;
if (userProfile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_ADMIN)) {
canExecuteSubObject = true;
} else {
if (subObject.getIsPublic() || subObject.getOwner().equals(userProfile.getUserId().toString())) {
canExecuteSubObject = true;
}
}
if (canExecuteSubObject) {
executionInstance.setSubObject(subObject);