public void onResponseReceived( Request request, Response response ) {
JsArrayString roles = parseRolesJson( JsonUtils.escapeJsonForEval( response.getText() ) );
// filter out existing
rolesListBox.clear();
PermissionsPanel permPanel = new PermissionsPanel( null );
for ( int i = 0; i < roles.length(); i++ ) {
String role = roles.get( i );
if ( !existing.contains( role ) ) {
rolesListBox.addItem( role );
}
else {
if( !permPanel.getNames( fileInfo, 1 ).contains( role ) && permPanel.getNames( fileInfo, 0 ).contains( role ) ) {
//we have equal user/role pair(s) and user already in existing list
rolesListBox.addItem( role );
}
}
}