public boolean canUpdate(int AD_Client_ID,int AD_Org_ID,int AD_Table_ID,int Record_ID,boolean createError){
  String userLevel=getUserLevel();
  if (userLevel.indexOf('S') != -1)   return true;
  boolean retValue=true;
  String whatMissing="";
  if (AD_Client_ID == 0 && AD_Org_ID == 0 && userLevel.charAt(0) != 'S') {
    retValue=false;
    whatMissing+="S";
  }
 else   if (AD_Client_ID != 0 && AD_Org_ID == 0 && userLevel.charAt(1) != 'C') {
    if (userLevel.charAt(2) == 'O' && isOrgAccess(AD_Org_ID,true))     ;
 else {
      retValue=false;
      whatMissing+="C";
    }
  }
 else   if (AD_Client_ID != 0 && AD_Org_ID != 0 && userLevel.charAt(2) != 'O') {
    retValue=false;
    whatMissing+="O";
  }
  if (retValue) {
    retValue=isClientAccess(AD_Client_ID,true);
  }
  if (retValue) {
    retValue=isOrgAccess(AD_Org_ID,true);
    whatMissing="W";
  }
  if (retValue)   retValue=isTableAccess(AD_Table_ID,false);
  if (retValue && Record_ID != 0)   retValue=isRecordAccess(AD_Table_ID,Record_ID,false);
  if (!retValue && createError) {
    log.saveWarning("AccessTableNoUpdate","AD_Client_ID=" + AD_Client_ID + ", AD_Org_ID="+ AD_Org_ID+ ", UserLevel="+ userLevel+ " => missing="+ whatMissing);
    log.warning(toString());
  }
  return retValue;
}

public boolean canUpdate ( int AD_Client_ID , int AD_Org_ID , int AD_Table_ID , int Record_ID , boolean createError ) { String userLevel = getUserLevel ( ) ; if ( userLevel . indexOf ( 'S' ) != - 1 ) return true ; boolean retValue = true ; String whatMissing = "" ; if ( AD_Client_ID == 0 && AD_Org_ID == 0 && userLevel . charAt ( 0 ) != 'S' ) { retValue = false ; whatMissing += "S" ; } else if ( AD_Client_ID != 0 && AD_Org_ID == 0 && userLevel . charAt ( 1 ) != 'C' ) { if ( userLevel . charAt ( 2 ) == 'O' && isOrgAccess ( AD_Org_ID , true ) ) ; else { retValue = false ; whatMissing += "C" ; } } else if ( AD_Client_ID != 0 && AD_Org_ID != 0 && userLevel . charAt ( 2 ) != 'O' ) { retValue = false ; whatMissing += "O" ; } if ( retValue ) { retValue = isClientAccess ( AD_Client_ID , true ) ; } if ( retValue ) { retValue = isOrgAccess ( AD_Org_ID , true ) ; whatMissing = "W" ; } if ( retValue ) retValue = isTableAccess ( AD_Table_ID , false ) ; if ( retValue && Record_ID != 0 ) retValue = isRecordAccess ( AD_Table_ID , Record_ID , false ) ; if ( ! retValue && createError ) { log . saveWarning ( "AccessTableNoUpdate" , "AD_Client_ID=" + AD_Client_ID + ", AD_Org_ID=" + AD_Org_ID + ", UserLevel=" + userLevel + " => missing=" + whatMissing ) ; log . warning ( toString ( ) ) ; } return retValue ; }
upadate - can i update the record . access error info ( accesstablenoupdate ) is saved in the log
