Skip to content
Snippets Groups Projects
Commit 0c203155 authored by juanf's avatar juanf
Browse files

SSDM-4686 : v3 roles bug - tests for update/delete spaces

SVN: 37695
parent a0ea0ca2
No related branches found
No related tags found
No related merge requests found
......@@ -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()
{
......
......@@ -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()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment