return;
} else {
AdminLogger.log(this.getClass(), "delete", "Deleting folder with name " + (UtilMethods.isSet(folder.getName()) ? folder.getName() + " ": "name not set "), user);
}
if (!papi.doesUserHavePermission(folder, PermissionAPI.PERMISSION_EDIT, user, respectFrontEndPermissions)) {
throw new DotSecurityException("User " + user + " does not have permission to edit " + folder.getName());
}
if(folder != null && FolderAPI.SYSTEM_FOLDER.equals(folder.getInode())) {
throw new DotSecurityException("YOU CANNOT DELETE THE SYSTEM FOLDER");
}
boolean localTransaction = false;
// start transactional delete
try {
localTransaction = DbConnectionFactory.getConnection().getAutoCommit();
if (localTransaction) {
HibernateUtil.startTransaction();
}
PermissionAPI papi = APILocator.getPermissionAPI();
if (!papi.doesUserHavePermission(folder, PermissionAPI.PERMISSION_EDIT_PERMISSIONS, user)) {
Logger.error(this.getClass(), "User " + user.getUserId() + " does not have permissions to folder " + folder.getInode());
throw new DotSecurityException("User " + "does not have edit permissions on folder " + folder.getTitle());
}
Folder faker = new Folder();
faker.setShowOnMenu(folder.isShowOnMenu());
faker.setInode(folder.getInode());