* @return GridPermissions object, built starting from user roles for the specified grid identifier
* @throws Throwable throwed if fetching operation does not correctly accomplished
*/
public GridPermissions getUserGridPermissions(String functionId,ArrayList userRoles,String[] columnAttributes,boolean[] columnsVisibility,boolean[] columnEditableInInsert,boolean[] columnsEditableInEdit,boolean[] columnsMandatory) throws Throwable{
ClientApplet applet = ( (ApplicationClientFacade)MDIFrame.getInstance().getClientFacade()).getMainClass();
GridPermissions serverPermissions = (GridPermissions)applet.getAuthorizations().getGridPermissions().get(functionId);
GridPermissions permissions = new GridPermissions(
functionId,
getUsername(),
(String[])columnAttributes.clone(),
(boolean[])columnsVisibility.clone(),
(boolean[])columnEditableInInsert.clone(),
(boolean[])columnsEditableInEdit.clone(),
(boolean[])columnsMandatory.clone()
);
if (serverPermissions==null)
return permissions;
boolean[] aux = serverPermissions.getColumnsEditabilityInInsert(); // editableColumnsInInsertFieldName
for(int i=0;i<aux.length;i++)
permissions.getColumnsEditabilityInInsert()[i] = permissions.getColumnsEditabilityInInsert()[i] && aux[i];
aux = serverPermissions.getColumnsEditabilityInEdit(); // editableColumnsInEdit
for(int i=0;i<aux.length;i++)
permissions.getColumnsEditabilityInEdit()[i] = permissions.getColumnsEditabilityInEdit()[i] && aux[i];
aux = serverPermissions.getColumnsMandatory(); // columnsMandatory
for(int i=0;i<aux.length;i++)
permissions.getColumnsMandatory()[i] = permissions.getColumnsMandatory()[i] || aux[i];
aux = serverPermissions.getColumnsVisibility(); // columnsVisibility
for(int i=0;i<aux.length;i++)
permissions.getColumnsVisibility()[i] = aux[i];
return permissions;
// Response res = ClientUtils.getData("dbGridPermissions",new Object[]{
// "getUserGridPermissions",