Skip to content
Snippets Groups Projects
Commit 6c44a945 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Handled sticky flag on UI

parent a7a135eb
No related branches found
No related tags found
No related merge requests found
Pipeline #990 passed
......@@ -26,6 +26,7 @@ public class NodeInfo {
private final String groupWrite;
private final boolean isPublic;
private final boolean asyncTrans;
private final boolean sticky;
private final boolean busy;
private final boolean listOfFiles;
......@@ -40,6 +41,7 @@ public class NodeInfo {
this.groupWrite = getGroupWrite(node);
this.isPublic = isPublic(node);
this.asyncTrans = isAsyncTrans(node);
this.sticky = isSticky(node);
this.busy = isBusy(node);
this.listOfFiles = isListOfFiles(node);
}
......@@ -70,11 +72,15 @@ public class NodeInfo {
}
private boolean isPublic(Node node) {
return getProperty(node, NodeProperties.PUBLIC_READ_URI).map(value -> "t".equals(value)).orElse(false);
return getProperty(node, NodeProperties.PUBLIC_READ_URI).map(value -> "true".equals(value)).orElse(false);
}
private boolean isAsyncTrans(Node node) {
return getProperty(node, "urn:async_trans").map(value -> "t".equals(value)).orElse(false);
return getProperty(node, NodeProperties.ASYNC_TRANS_URN).map(value -> "true".equals(value)).orElse(false);
}
private boolean isSticky(Node node) {
return getProperty(node, NodeProperties.STICKY_URN).map(value -> "true".equals(value)).orElse(false);
}
private boolean isBusy(Node node) {
......@@ -175,6 +181,10 @@ public class NodeInfo {
return asyncTrans;
}
public boolean isSticky() {
return sticky;
}
public boolean isBusy() {
return busy;
}
......
......@@ -3,6 +3,7 @@ package it.inaf.ia2.vospace.ui.service;
import it.inaf.ia2.aa.data.User;
import it.inaf.ia2.vospace.ui.client.VOSpaceClient;
import it.inaf.ia2.vospace.ui.data.ListNodeData;
import it.inaf.oats.vospace.datamodel.NodeProperties;
import it.inaf.oats.vospace.datamodel.NodeUtils;
import java.io.IOException;
import java.io.StringWriter;
......@@ -75,7 +76,7 @@ public class NodesService {
html += "<td>" + nodeInfo.getGroupRead() + "</td>";
html += "<td>" + nodeInfo.getGroupWrite() + "</td>";
html += "<td>";
if (NodeUtils.checkIfWritable(node, user.getName(), user.getGroups())) {
if (NodeUtils.checkIfWritable(node, user.getName(), user.getGroups()) && !nodeInfo.isSticky()) {
html += "<span class=\"icon trash-icon pointer\" onclick=\"deleteNode('" + nodeInfo.getPath() + "')\"></span>";
}
html += "</td>";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment