}
private final void assignViewerAndEditorRole(String sessionId, FolderElement fe, View view,
boolean isPublic, boolean isEditable) throws SQLException {
IRoleManagement roleMgmt = MapperRegistry.getInstance().getRoleManagement();
Role viewerRole = (Role) roleMgmt.findByName("VIEWER");
if (viewerRole == null) {
viewerRole = new RoleImpl.Builder(null).name("VIEWER").
permission(Right.READ).build();
roleMgmt.insert(viewerRole);
}
Role editorRole = (Role) roleMgmt.findByName("EDITOR");
if (editorRole == null) {
editorRole = new RoleImpl.Builder(null).name("EDITOR").
permission(Right.CREATE).build();
roleMgmt.insert(editorRole);
}