permission(Right.CREATE).build();
roleMgmt.insert(editorRole);
}
try {
FolderService folderService = ServiceProvider
.getFolderService(getLoggedInUser(sessionId));
if (!fe.hasRole(viewerRole) && isPublic) {
try {
folderService.add(viewerRole, fe);
} catch (OperationFailedException e) {
e.printStackTrace();
}
}
if (!fe.hasRole(editorRole) && isEditable) {
try {
folderService.add(editorRole, fe);
} catch (OperationFailedException e) {
e.printStackTrace();
}
}
ExplorerTreeNode nd = fe.getParent();
while (nd != null) {
if (!nd.hasRole(viewerRole) && isPublic) {
try {
folderService.add(viewerRole, nd);
} catch (OperationFailedException e) {
e.printStackTrace();
}
}
if (!nd.hasRole(editorRole) && isEditable) {
try {
folderService.add(editorRole, nd);
} catch (OperationFailedException e) {
e.printStackTrace();
}
}
nd = nd.getParent();