else if (type.equals(XGroup.TYPE))
delete(sessionId, getNative(sessionId, (XGroup) xObj));
else if (type.equals(XRole.TYPE))
delete(sessionId, getNative(sessionId, (XRole) xObj));
else if (type.equals(XUser.TYPE)) {
User user = getNative(sessionId, (XUser) xObj);
IViewManagement viewManagement = MapperRegistry.getInstance().getViewManagement();
try {
try {
IFolderManagement folders = MapperRegistry.getInstance().
getFolderManagement();
AuthUser aUser = ServiceProvider.getAuthenticationService().authenticateHash(user.getLoginName(),
user.getPassword());
List <ExplorerTreeNode> nodes = folders.reallyGetFolders(aUser);
for (ExplorerTreeNode nd: nodes) {
folders.delete(nd);
}
} catch (SQLException e) {
e.printStackTrace();
} catch (AuthenticationFailedException e) {
e.printStackTrace();
}
List <View> allViews = viewManagement.findViews(user);
ViewService viewService = ServiceProvider.getViewService(getLoggedInUser(sessionId));
// At this point, the user has agreed to map all his views to admin...
if (!viewManagement.findViews(user).isEmpty()) {
User adminUser = getLoggedInUser(sessionId);
try {
CubeViewReader.CHECK_RIGHTS = false;
for (View v: allViews) {
viewService.setOwner(adminUser, v);
viewService.save(v);