} finally {
CubeViewReader.CHECK_RIGHTS = true;
}
}
} catch (SQLException e) {
UserSession userSession = getUserSession(sessionId);
throw new OperationFailedException(userSession.translate("deletionFailed"));
}
delete(sessionId, getNative(sessionId, (XUser) xObj));
}
} catch (OperationFailedException e) {
UserSession userSession = getUserSession(sessionId);
String message = userSession.translate("unknownReason");
String type = xObj.getType();
if (type.equals(XAccount.TYPE)) {
message = userSession.translate("viewsUsingThisAccount");
} else if (type.equals(XConnection.TYPE)) {
message = userSession.translate("accountsUsingThisConnection");
} else if (type.equals(XGroup.TYPE)) {
message = userSession.translate("usersUsingThisGroup");
} else if (type.equals(XRole.TYPE)) {
message = userSession.translate("usersOrGroupsUsingThisRole");
} else if (type.equals(XUser.TYPE)) {
message = userSession.translate("viewsCreatedByThisUser");
}
throw new DbOperationFailedException(userSession.translate("couldNotDelete", xObj.getName(), message), e);
}
}