}
} else if(InodeUtils.isSet(f.getInode()) && !permAPI.doesUserHavePermission(f, PermissionAPI.PERMISSION_EDIT, user)){
throw new DotSecurityException("You don't have permissions to edit this folder");
}
FolderForm folderForm = (FolderForm) form;
HibernateUtil.startTransaction();
try {
if (InodeUtils.isSet(f.getInode()) && !folderForm.getName().equalsIgnoreCase(f.getName())) {
if (!folderAPI.renameFolder(f,folderForm.getName(),user,false)) {
// For messages to be displayed on messages page
SessionMessages.add(req, "message", "message.folder.alreadyexists");
return false;
}
}
f.setName(folderForm.getName());
f.setTitle(folderForm.getTitle());
f.setFilesMasks(folderForm.getFilesMasks());
f.setShowOnMenu(folderForm.isShowOnMenu());
f.setSortOrder(folderForm.getSortOrder());
f.setOwner(folderForm.getOwner());
String defaultFileType = req.getParameter("defaultFileType");
if(!InodeUtils.isSet(defaultFileType)){
SessionMessages.add(req, "message", "message.folder.defaultfiletype.required");
return false;
}