public void renameFolder(String sessionId, XStaticFolder folder, String newName) throws DbOperationFailedException,
SessionExpiredException {
FolderService folderService = ServiceProvider
.getFolderService(getLoggedInUser(sessionId));
AuthUser user = getLoggedInUser(sessionId);
boolean mayWrite = false;
for (Role r: user.getRoles()) {
if (r.hasPermission(Right.WRITE)) {
mayWrite = true;
break;
}
}
if (!mayWrite) {
for (Group g: user.getGroups()) {
for (Role r: g.getRoles()) {
if (r.hasPermission(Right.WRITE)) {
mayWrite = true;
break;
}