private void validateAdminPermissions(AccessTestAction action) throws Exception { verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); } }
@Test public void testGetRSGroupInfoOfTable() throws Exception { AccessTestAction action = () -> { rsGroupAdminEndpoint.checkPermission("getRSGroupInfoOfTable"); return null; }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); }
@Test public void testMoveTables() throws Exception { AccessTestAction action = () -> { rsGroupAdminEndpoint.checkPermission("moveTables"); return null; }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); }
@Test public void testMoveServersAndTables() throws Exception { AccessTestAction action = () -> { rsGroupAdminEndpoint.checkPermission("moveServersAndTables"); return null; }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); } }
@Test public void testMoveServers() throws Exception { AccessTestAction action = () -> { rsGroupAdminEndpoint.checkPermission("moveServers"); return null; }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); }
@Test public void testAddRSGroup() throws Exception { AccessTestAction action = () -> { rsGroupAdminEndpoint.checkPermission("addRSGroup"); return null; }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); }
@Test public void testRemoveRSGroup() throws Exception { AccessTestAction action = () -> { rsGroupAdminEndpoint.checkPermission("removeRSGroup"); return null; }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); }
@Test public void testBalanceRSGroup() throws Exception { AccessTestAction action = () -> { rsGroupAdminEndpoint.checkPermission("balanceRSGroup"); return null; }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); }
@Test public void testGetRSGroupInfo() throws Exception { AccessTestAction action = () -> { rsGroupAdminEndpoint.checkPermission("getRSGroupInfo"); return null; }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); }
@Test public void testListRSGroup() throws Exception { AccessTestAction action = () -> { rsGroupAdminEndpoint.checkPermission("listRSGroup"); return null; }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); }
@Test public void testGetRSGroupInfoOfServer() throws Exception { AccessTestAction action = () -> { rsGroupAdminEndpoint.checkPermission("getRSGroupInfoOfServer"); return null; }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); }