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

Added support for administrator group (can access all nodes)

parent 8d8f0bbe
No related branches found
No related tags found
No related merge requests found
Pipeline #7877 passed
......@@ -165,6 +165,10 @@ public class NodeUtils {
return false;
}
if (userGroups.contains("VOSpace.ADMIN")) {
return true;
}
List<String> groupAccessPropValues
= NodeProperties.getNodePropertyAsListByURI(myNode,
accessPropertyName);
......
......@@ -248,6 +248,20 @@ public class NodeUtilsTest {
assertFalse(NodeUtils.checkIfWritable(node, "user2", List.of()));
}
@Test
public void testCheckWritableNoProperty() {
Node node = new DataNode();
assertFalse(NodeUtils.checkIfWritable(node, "user2", List.of("group1")));
}
@Test
public void testCheckAdminCanAlwaysAccess() {
Node node = new DataNode();
assertTrue(NodeUtils.checkIfWritable(node, "user2", List.of("VOSpace.ADMIN")));
}
@Test
public void testGetVosPath() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment