diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteSpaceTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteSpaceTest.java index 3adbda70cb85fe1166d03d054909d9e325fa79b9..3b83e98543df7e1e740d072179edde1fc40601f1 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteSpaceTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteSpaceTest.java @@ -50,6 +50,24 @@ public class DeleteSpaceTest extends AbstractDeletionTest v3api.deleteSpaces(sessionToken, new ArrayList<SpacePermId>(), options); } + @Test + public void testDeleteSpaceWithAdminUserInAnotherSpace() + { + final String sessionToken = v3api.login(TEST_ROLE_V3, PASSWORD); + + final SpaceDeletionOptions options = new SpaceDeletionOptions(); + options.setReason("It is just a test"); + + assertUnauthorizedObjectAccessException(new IDelegatedAction() + { + @Override + public void execute() + { + v3api.deleteSpaces(sessionToken, Arrays.asList(new SpacePermId("TEST-SPACE")), options); + } + }, new SpacePermId("TEST-SPACE")); + } + @Test public void testDeleteEmptySpace() { diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/UpdateSpaceTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/UpdateSpaceTest.java index f198faf16bce0e26be1c433b81926285c03f43a4..253ded59fb5ce393f58fa4d26d354877e6bd5498 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/UpdateSpaceTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/UpdateSpaceTest.java @@ -55,6 +55,25 @@ public class UpdateSpaceTest extends AbstractTest }, spaceId); } + @Test + public void testUpdateSpaceWithAdminUserInAnotherSpace() + { + final String sessionToken = v3api.login(TEST_ROLE_V3, PASSWORD); + final SpacePermId spaceId = new SpacePermId("TEST-SPACE"); + + final SpaceUpdate update = new SpaceUpdate(); + update.setSpaceId(spaceId); + + assertUnauthorizedObjectAccessException(new IDelegatedAction() + { + @Override + public void execute() + { + v3api.updateSpaces(sessionToken, Arrays.asList(update)); + } + }, spaceId); + } + @Test public void testUpdateWithSpaceNonexistent() {