use of org.geosdi.geoplatform.request.organization.WSPutRolePermissionRequest in project geo-platform by geosdi.
the class UserService method updateRolePermission.
@Override
public boolean updateRolePermission(String role, String organization, HashMap<String, Boolean> permissionMap, HttpServletRequest httpServletRequest) throws GeoPlatformException {
GuiComponentsPermissionMapData rolePermission = new GuiComponentsPermissionMapData();
rolePermission.setPermissionMap(permissionMap);
try {
return geoPlatformServiceClient.updateRolePermission(new WSPutRolePermissionRequest(rolePermission, role, organization));
} catch (ResourceNotFoundFault ex) {
logger.error(this.getClass().getSimpleName(), ex.getMessage());
throw new GeoPlatformException("Unable to find \"" + role + "\" role");
}
}
use of org.geosdi.geoplatform.request.organization.WSPutRolePermissionRequest in project geo-platform by geosdi.
the class RSRolePermissionTest method updateRolePermissionTestRest.
@Test(expected = NotFoundException.class)
public void updateRolePermissionTestRest() throws Exception {
GuiComponentsPermissionMapData userMapData = new GuiComponentsPermissionMapData();
userMapData.setPermissionMap(new HashMap<>(GuiComponentIDs.MAP_USER));
assertTrue(gpWSClient.updateRolePermission(new WSPutRolePermissionRequest(userMapData, USER.getRole(), organizationNameRSTest)));
GuiComponentsPermissionMapData wsUserMapData = gpWSClient.getRolePermission(USER.getRole(), organizationNameRSTest);
logger.trace("\n\n@@@@@@@@@@@@@@@@@@@@@@@@@@@RETRIEVE GuiComponents for USER_ROLE : {}\n\n", wsUserMapData);
assertEquals(51, wsUserMapData.getPermissionMap().size());
GuiComponentsPermissionMapData viewerMapData = new GuiComponentsPermissionMapData();
viewerMapData.setPermissionMap(new HashMap<>(MAP_VIEWER));
assertTrue(gpWSClient.updateRolePermission(new WSPutRolePermissionRequest(viewerMapData, VIEWER.getRole(), organizationNameRSTest)));
GuiComponentsPermissionMapData wsViewerMapData = gpWSClient.getRolePermission(VIEWER.getRole(), organizationNameRSTest);
logger.trace("\n\n@@@@@@@@@@@@@@@@@@@@@@@@@@@RETRIEVE GuiComponents for VIEWER_ROLE : {}\n\n", wsViewerMapData);
assertEquals(50, wsViewerMapData.getPermissionMap().size());
}
use of org.geosdi.geoplatform.request.organization.WSPutRolePermissionRequest in project geo-platform by geosdi.
the class GPJacksonRolePermissionsSupportTest method putRolePermissionDataMappingTest.
@Test
public void putRolePermissionDataMappingTest() throws Exception {
WSPutRolePermissionRequest putPermissionReques = jacksonSupport.getDefaultMapper().readValue(Thread.currentThread().getContextClassLoader().getResourceAsStream(PUT_ROLE_PERMISSION_REQUEST_DATA_JSON), WSPutRolePermissionRequest.class);
logger.info("\n\n@@@@@@@@@@@@@@PUT_ROLE_PERMISSION_REQUEST_DATA_MAPPING" + " : {}\n\n", putPermissionReques);
super.marshall(putPermissionReques);
}
Aggregations